Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Commit

Permalink
linting + pass current tests hopefully
Browse files Browse the repository at this point in the history
  • Loading branch information
Vucis committed May 21, 2024
1 parent 68be2c5 commit 24feab4
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 24 deletions.
18 changes: 10 additions & 8 deletions frontend/cypress/e2e/Header.cy.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
// e2e needs to check that you can actually go from certain page to other pages using navbar/header
// also logout and maybe changing language? (how to test language stuff?)
// component tests that everything is present that has to be present
describe('Header functionality', () => {
it('Header Login', () => {
cy.visit('http://localhost:5173')
cy.contains('Login').should('be.visible').should('have.attr', 'href').and('include', 'login.microsoftonline.com')
// good enough test, will need to test validity of url some other way because can't really login if we can't make our own account for testing
})

})
describe("Header functionality", () => {
it("Header Login", () => {
cy.visit("http://localhost:5173");
cy.contains("Login")
.should("be.visible")
.should("have.attr", "href")
.and("include", "login.microsoftonline.com");
// good enough test, will need to test validity of url some other way because can't really login if we can't make our own account for testing
});
});
33 changes: 19 additions & 14 deletions frontend/cypress/e2e/HomePageTests.cy.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
describe('Homepage not logged in functionality', () => {
it('Header Visible', () => {
cy.visit('http://localhost:5173')
cy.contains('Peristerónas')
cy.get('header').should('be.visible')
})

it('Center button Login', () => {
cy.visit('http://localhost:5173')
cy.contains('Peristerónas')
cy.get('a.MuiButtonBase-root.MuiButton-root.MuiButton-contained.MuiButton-containedPrimary.MuiButton-sizeMedium.MuiButton-containedSizeMedium.MuiButton-colorPrimary.MuiButton-root.MuiButton-contained.MuiButton-containedPrimary.MuiButton-sizeMedium.MuiButton-containedSizeMedium.MuiButton-colorPrimary.css-sghohy-MuiButtonBase-root-MuiButton-root')
.eq(1).contains('Login').should('be.visible').should('have.attr', 'href').and('include', 'login.microsoftonline.com')
})
})
describe("Homepage not logged in functionality", () => {
it("Header Visible", () => {
cy.visit("http://localhost:5173");
cy.contains("Peristerónas");
cy.get("header").should("be.visible");
});

it("Center button Login", () => {
cy.visit("http://localhost:5173");
cy.contains("Peristerónas");
cy.get(
"a.MuiButtonBase-root.MuiButton-root.MuiButton-contained.MuiButton-containedPrimary.MuiButton-sizeMedium.MuiButton-containedSizeMedium.MuiButton-colorPrimary.MuiButton-root.MuiButton-contained.MuiButton-containedPrimary.MuiButton-sizeMedium.MuiButton-containedSizeMedium.MuiButton-colorPrimary.css-sghohy-MuiButtonBase-root-MuiButton-root"
)
.eq(1)
.contains("Login")
.should("be.visible")
.should("have.attr", "href")
.and("include", "login.microsoftonline.com");
});
});
4 changes: 2 additions & 2 deletions frontend/tests/unit/header.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ import { describe, test } from "vitest";
import { render } from '@testing-library/react';

Check failure on line 2 in frontend/tests/unit/header.test.tsx

View workflow job for this annotation

GitHub Actions / Frontend-tests

'render' is defined but never used

describe("Header", () => {

test.todo("Header test");

Check failure on line 5 in frontend/tests/unit/header.test.tsx

View workflow job for this annotation

GitHub Actions / Frontend-tests

Expected indentation of 2 spaces but found 4
})
test.todo("Header test");

Check failure on line 7 in frontend/tests/unit/header.test.tsx

View workflow job for this annotation

GitHub Actions / Frontend-tests

Too many blank lines at the end of file. Max of 0 allowed

0 comments on commit 24feab4

Please sign in to comment.