-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
97c2943
commit b6c0d63
Showing
9 changed files
with
82 additions
and
39 deletions.
There are no files selected for viewing
30 changes: 15 additions & 15 deletions
30
frontend/frontend/cypress/page/assignmentPage/AssignmentPage.cy.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
import {AssignmentPage} from '../../../src/pages/assignmentPage/AssignmentPage'; // Check if the file path is correct and if the required module exists in the specified location. | ||
import {BrowserRouter} from 'react-router-dom'; | ||
import fixtures from '../../fixtures/fixtures.json'; | ||
import { AssignmentPage } from '../../../src/pages/assignmentPage/AssignmentPage' | ||
import { BrowserRouter } from 'react-router-dom' | ||
|
||
// This page fetches data from the backend. | ||
// So as far as the component test is concerned, | ||
// we can only show what shows up before the fetch. | ||
// This is why only the loading animation is checked. | ||
// The rest of the tests are in the integration tests. | ||
describe('AssignmentPage', () => { | ||
|
||
it('renders', () => { | ||
cy.mount(<BrowserRouter><AssignmentPage/></BrowserRouter>); | ||
// this renders for a student, teacher will be tested in e2e tests | ||
cy.get('#logo').should('exist'); | ||
cy.get('#userMenu').should('exist'); | ||
|
||
cy.contains('Deadline: no deadline'); | ||
cy.contains('Status'); | ||
cy.contains('Confirm Upload'); | ||
cy.get('#uploadButton').should('exist'); | ||
}); | ||
}); | ||
cy.mount( | ||
<BrowserRouter> | ||
<AssignmentPage /> | ||
</BrowserRouter> | ||
) | ||
cy.get('[data-cy=loadingAnimation]').should('exist') | ||
}) | ||
}) |
18 changes: 18 additions & 0 deletions
18
frontend/frontend/cypress/page/groupsPage/ChooseGroup.cy.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { ChooseGroup } from '../../../src/pages/groupsPage/ChooseGroup' | ||
import { BrowserRouter } from 'react-router-dom' | ||
|
||
// This page fetches data from the backend. | ||
// So as far as the component test is concerned, | ||
// we can only show what shows up before the fetch. | ||
// This is why only the loading animation is checked. | ||
// The rest of the tests are in the integration tests. | ||
describe('ChooseGroup', () => { | ||
it('renders', () => { | ||
cy.mount( | ||
<BrowserRouter> | ||
<ChooseGroup /> | ||
</BrowserRouter> | ||
) | ||
cy.get('[data-cy=loadingAnimation]').should('exist') | ||
}) | ||
}) |
28 changes: 17 additions & 11 deletions
28
frontend/frontend/cypress/page/groupsPage/GroupsPage.cy.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,18 @@ | ||
import { GroupsPage } from "../../../src/pages/groupsPage/GroupsPage"; | ||
import { BrowserRouter } from "react-router-dom"; | ||
import fixtures from "../../fixtures/fixtures.json"; | ||
import { GroupsPage } from '../../../src/pages/groupsPage/GroupsPage' | ||
import { BrowserRouter } from 'react-router-dom' | ||
|
||
describe("GroupsPage", () => { | ||
it("renders", () => { | ||
cy.mount(<BrowserRouter><GroupsPage/></BrowserRouter>); | ||
cy.get("#logo").should("exist"); | ||
cy.get("#userMenu").should("exist"); | ||
cy.contains("Project 1: groepen"); | ||
}); | ||
}); | ||
// This page fetches data from the backend. | ||
// So as far as the component test is concerned, | ||
// we can only show what shows up before the fetch. | ||
// This is why only the loading animation is checked. | ||
// The rest of the tests are in the integration tests. | ||
describe('GroupsPage', () => { | ||
it('renders', () => { | ||
cy.mount( | ||
<BrowserRouter> | ||
<GroupsPage /> | ||
</BrowserRouter> | ||
) | ||
cy.get('[data-cy=loadingAnimation]').should('exist') | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
import {LoginPage} from '../../../src/pages/loginPage/LoginPage.tsx'; | ||
import {BrowserRouter} from 'react-router-dom'; | ||
import { LoginPage } from '../../../src/pages/loginPage/LoginPage.tsx' | ||
import { BrowserRouter } from 'react-router-dom' | ||
|
||
describe('LoginPage', () => { | ||
it('renders', () => { | ||
cy.mount(<BrowserRouter><LoginPage/></BrowserRouter>); | ||
cy.get('#logo').should('exist'); | ||
cy.get('#loginButton').should('exist'); | ||
cy.contains('Pigeonhole'); | ||
}); | ||
}); | ||
cy.mount( | ||
<BrowserRouter> | ||
<LoginPage /> | ||
</BrowserRouter> | ||
) | ||
cy.get('#logo').should('exist') | ||
cy.get('[data-cy=loginButton]').should('exist') | ||
cy.get('[data-cy=logoDuif]').should('exist') | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters