-
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.
Merge branch 'frontend_testen' of github.com:SELab-2/UGent-4 into fro…
…ntend_testen
- Loading branch information
Showing
6 changed files
with
76 additions
and
43 deletions.
There are no files selected for viewing
31 changes: 17 additions & 14 deletions
31
frontend/frontend/cypress/page/scoresPage/ProjectScoresPage.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,15 +1,18 @@ | ||
import { ProjectScoresPage } from "../../../src/pages/scoresPage/ProjectScoresPage"; | ||
import { BrowserRouter } from "react-router-dom"; | ||
import { ProjectScoresPage } from '../../../src/pages/scoresPage/ProjectScoresPage' | ||
import { BrowserRouter } from 'react-router-dom' | ||
|
||
describe("ProjectScoresPage", () => { | ||
it("renders", () => { | ||
cy.mount(<BrowserRouter><ProjectScoresPage/></BrowserRouter>); | ||
cy.get("#logo").should("exist"); | ||
cy.get("#userMenu").should("exist"); | ||
cy.contains("Scores"); | ||
cy.get('#exportSubmissionsButton').should('exist'); | ||
cy.get('#uploadScoresButton').should('exist'); | ||
cy.get('#saveScoresButton').should('exist'); | ||
cy.get('#deleteScoresButton').should('exist'); | ||
}); | ||
}); | ||
// 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('ProjectScoresPage', () => { | ||
it('renders', () => { | ||
cy.mount( | ||
<BrowserRouter> | ||
<ProjectScoresPage /> | ||
</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
31 changes: 18 additions & 13 deletions
31
frontend/frontend/cypress/page/scoresPage/studentsView.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,20 +1,25 @@ | ||
import { StudentsView } from "../../../src/pages/scoresPage/StudentsView"; | ||
import { BrowserRouter } from "react-router-dom"; | ||
import fixtures from "../../fixtures/fixtures.json"; | ||
|
||
describe("StudentsView", () => { | ||
import { StudentsView } from '../../../src/pages/scoresPage/StudentsView' | ||
import { BrowserRouter } from 'react-router-dom' | ||
import fixtures from '../../fixtures/fixtures.json' | ||
import { t } from 'i18next' | ||
|
||
describe('StudentsView', () => { | ||
const mockProps = { | ||
project: fixtures.fullProject, | ||
groepen: fixtures.scoreGroups, | ||
setGroepen: () => {}, | ||
changeScore: () => {}, | ||
}; | ||
|
||
it("renders", () => { | ||
cy.mount(<BrowserRouter><StudentsView {...mockProps}/></BrowserRouter>); | ||
for (let i = 0; i < mockProps.groepen.length; i++) { | ||
cy.get(`#group${mockProps.groepen[i].group_number}`).should('exist'); | ||
} | ||
}); | ||
}); | ||
|
||
it('renders', () => { | ||
cy.mount( | ||
<BrowserRouter> | ||
<StudentsView {...mockProps} /> | ||
</BrowserRouter> | ||
) | ||
//cy.get('[data-cy=groupHeader]').should('have.text', t('group')) | ||
//cy.get('[data-cy=timeHeader]').should('have.text', t('time')) | ||
cy.get('[data-cy=scoreHeader]').should('have.text', 'Score') | ||
cy.get('[data-cy=downloadHeader]').should('have.text', 'Download') | ||
}) | ||
}) |
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