Skip to content

Commit

Permalink
Merge branch 'frontend_testen' of https://github.com/SELab-2/UGent-4
Browse files Browse the repository at this point in the history
…into frontend_testen
  • Loading branch information
mathis2003 committed May 23, 2024
2 parents b6c0d63 + 3472d12 commit 4886871
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 20 deletions.
24 changes: 15 additions & 9 deletions frontend/frontend/cypress/e2e/student/group.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,24 @@ describe('student chooses a group and leaves', () => {
beforeEach(() => {
cy.visit('http://localhost:5173')
})

it('choose', () => {
cy.contains('test course').click()
cy.contains('test project').click()

// TODO
})

it('leave', () => {
// student should be in a group because of the teacher groups test
cy.contains('test course').click()
cy.contains('test project').click()

// TODO
cy.get('#group').click()
cy.contains('Student Testing').should('exist')
cy.get('#leaveGroup').click()
cy.contains('No members yet').should('exist')
})

it('join', () => {
cy.contains('test course').click()
cy.contains('test project').click()
cy.get('#group').click()
cy.contains('No members yet').should('exist')
cy.get('#joinGroup').click()
cy.contains('Student Testing').should('exist')
})

})
17 changes: 10 additions & 7 deletions frontend/frontend/cypress/e2e/teacher/groups.cy.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
escribe('add students to groups or let them choose', () => {
describe('add students to groups or let them choose', () => {
beforeEach(() => {
cy.visit('http://localhost:5173')
})

it('add', () => {
cy.contains('test course').click()
cy.contains('test project').click()


// TODO add students to group
cy.get('#groupButton').click()
cy.get('#randomGroups').click()
cy.get('#confirm').click()
cy.get('#saveGroups').click()
cy.get('#confirm').click()
})

it('choose', () => {
cy.contains('test course').click()
cy.contains('test project').click()


// TODO let students choose a group
cy.get('#groupButton').click()
cy.get('#studentsChoose').click()
cy.get('#saveGroups').click()
cy.get('#confirm').click()
})


Expand Down
1 change: 1 addition & 0 deletions frontend/frontend/cypress/e2e/teacher/project.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ describe('add and change projects', () => {
cy.get('.MuiInputBase-input').eq(1).type('220820242359')
cy.get('.MuiInputBase-input').eq(2).type('290820242359')
cy.get('#description').type('This is a test project set up by the e2e tests.')
cy.get('#setInVisible').click()
cy.get('#setVisible').click()
cy.get('#groupSize').clear().type('2')
cy.get('#maxScore').clear().type('30')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -972,7 +972,7 @@ export function AddChangeAssignmentPage() {
<IconButton
// Allows the teacher to select whether
// the assignment is visible to students or not.
id='setVisible'
id='setInVisible'
color={'info'}
onClick={() =>
setVisible(
Expand All @@ -988,7 +988,7 @@ export function AddChangeAssignmentPage() {
</IconButton>
) : (
<IconButton
id='setInvisible'
id='setVisible'
color={'info'}
onClick={() =>
setVisible(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -855,6 +855,7 @@ export function AssignmentPage() {
<>
{assignment?.student_groep ? (
<Button
id='group'
sx={{
bgcolor:
'secondary.main',
Expand Down
4 changes: 2 additions & 2 deletions frontend/frontend/src/pages/groupsPage/ChooseGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function joinLeaveButton(
if (isin) {
return (
<>
<Button size={'small'} onClick={handleLeave}>
<Button id='leaveGroup' size={'small'} onClick={handleLeave}>
<Typography>{t('leave')}</Typography>
</Button>
</>
Expand All @@ -66,7 +66,7 @@ function joinLeaveButton(
}
return (
<>
<Button size={'small'} onClick={handleJoin}>
<Button id= 'joinGroup' size={'small'} onClick={handleJoin}>
<Typography>{t('join_group')}</Typography>
</Button>
</>
Expand Down
3 changes: 3 additions & 0 deletions frontend/frontend/src/pages/groupsPage/GroupsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,7 @@ export function GroupsPage() {
<Button
// If a teacher doesn't want to create groups manually,
// they can randomize the groups with a single click.variant={'contained'}
id='randomGroups'
onClick={() =>
setRandomOpen(true)
}
Expand Down Expand Up @@ -480,6 +481,7 @@ export function GroupsPage() {
/>
) : (
<Switch
id='studentsChoose'
checked={
studentsCanChoose
}
Expand Down Expand Up @@ -978,6 +980,7 @@ export function GroupsPage() {
>
<IconButton
// The teacher can save the group changes by clicking on the save icon.type="submit"
id='saveGroups'
aria-label={
'submit'
}
Expand Down

0 comments on commit 4886871

Please sign in to comment.