Skip to content

Commit

Permalink
Merge pull request #4662 from UniversityOfHelsinkiCS/misc-updates
Browse files Browse the repository at this point in the history
Misc updates
  • Loading branch information
rikurauhala authored Oct 29, 2024
2 parents 2dc74af + f34cc2c commit 34a479c
Show file tree
Hide file tree
Showing 28 changed files with 254 additions and 236 deletions.
8 changes: 4 additions & 4 deletions cypress/e2e/Evaluation_overview.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ describe('Evaluation overview', () => {
})

it('Progress data is shown correctly with graduated included', () => {
cy.get('[data-cy="Graph-StudytrackProgress"]').within(() => {
cy.get('[data-cy="Graph-StudyTrackProgress"]').within(() => {
const totalStats = ['12.9%', '6.9%', '9.7%', '9.2%', '3.7%', '6.0%', '51.6%']
for (const stat of totalStats) {
cy.contains(stat)
Expand All @@ -36,12 +36,12 @@ describe('Evaluation overview', () => {
['Total', 217, 28, 15, 21, 20, 8, 13, 112],
]

cy.checkTableStats(tableContents, 'StudytrackProgress')
cy.checkTableStats(tableContents, 'StudyTrackProgress')
})

it('Progress data is shown correctly with graduated excluded', () => {
cy.get('[data-cy=GraduatedToggle]').click()
cy.get('[data-cy="Graph-StudytrackProgress"]').within(() => {
cy.get('[data-cy="Graph-StudyTrackProgress"]').within(() => {
const totalStats = ['30.8%', '15.4%', '22.0%', '20.9%', '4.4%', '5.5%']
for (const stat of totalStats) {
cy.contains(stat)
Expand All @@ -62,7 +62,7 @@ describe('Evaluation overview', () => {
['Total', 91, 28, 14, 20, 19, 4, 1, 5],
]

cy.checkTableStats(tableContents, 'StudytrackProgress')
cy.checkTableStats(tableContents, 'StudyTrackProgress')
})

it('Graduation times breakdown data is shown correctly', () => {
Expand Down
96 changes: 49 additions & 47 deletions cypress/e2e/Studyprogramme_overview.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@ const deleteTag = name => {
cy.contains('td', name).should('not.exist')
}

describe('Studyprogramme overview', () => {
describe('Study programme overview', () => {
/* Basic information overview -tests */
describe('Basic information -view works for basic user', () => {
describe('Basic information view works for basic user', () => {
beforeEach(() => {
cy.init('/study-programme')
cy.contains('a', 'Matemaattisten tieteiden kandiohjelma').click({ force: true })
})

// If the backend breaks for one of the sections, the section header is not rendered and this will fail
it('Basic information -tab loads', () => {
cy.get('[data-cy=Section-StudentsOfTheStudyprogramme]')
cy.get('[data-cy=Section-CreditsProducedByTheStudyprogramme]')
it('Basic information tab loads', () => {
cy.get('[data-cy=Section-StudentsOfTheStudyProgramme]')
cy.get('[data-cy=Section-CreditsProducedByTheStudyProgramme]')
cy.get('[data-cy=Section-GraduatedAndThesisWritersOfTheProgramme]')
cy.get('[data-cy=Section-ProgrammesBeforeOrAfter]')
cy.get('[data-cy=Section-AverageGraduationTimes]')
Expand All @@ -40,7 +40,7 @@ describe('Studyprogramme overview', () => {
[2017, 41, 47, 0, 0, 0],
]

cy.checkTableStats(tableContents, 'StudentsOfTheStudyprogramme')
cy.checkTableStats(tableContents, 'StudentsOfTheStudyProgramme')
})

it('Basic information contains correct credits', () => {
Expand All @@ -56,7 +56,7 @@ describe('Studyprogramme overview', () => {
[2017, 1211, 1211, 0, 0, 189],
]

cy.checkTableStats(tableContents, 'CreditsProducedByTheStudyprogramme')
cy.checkTableStats(tableContents, 'CreditsProducedByTheStudyProgramme')
})

it("Toggling 'Show special categories' on displays additional information", () => {
Expand All @@ -73,7 +73,7 @@ describe('Studyprogramme overview', () => {
[2017, 1211, 1211, 0, 0, 0, 0, 189],
]

cy.checkTableStats(tableContents, 'CreditsProducedByTheStudyprogramme')
cy.checkTableStats(tableContents, 'CreditsProducedByTheStudyProgramme')
})

it('Basic information contains correct thesis writers and graduates', () => {
Expand All @@ -93,7 +93,7 @@ describe('Studyprogramme overview', () => {
cy.checkTableStats(tableContents, 'GraduatedAndThesisWritersOfTheProgramme')
})

it('Special studyrights can be excluded and basic data changes accordingly', () => {
it('Special study rights can be excluded and basic data changes accordingly', () => {
cy.get('[data-cy=StudentToggle]').click()
const years = getEmptyYears()
const studentTableContents = [
Expand All @@ -108,7 +108,7 @@ describe('Studyprogramme overview', () => {
[2017, 41, 47, 0],
]

cy.checkTableStats(studentTableContents, 'StudentsOfTheStudyprogramme')
cy.checkTableStats(studentTableContents, 'StudentsOfTheStudyProgramme')

const graduatedTableContents = [
// [Year, Graduated, Wrote thesis]
Expand Down Expand Up @@ -140,7 +140,7 @@ describe('Studyprogramme overview', () => {
['2018 - 2019', 40, 45, 0, 0, 0],
['2017 - 2018', 41, 47, 0, 0, 0],
]
cy.checkTableStats(studentTableContents, 'StudentsOfTheStudyprogramme')
cy.checkTableStats(studentTableContents, 'StudentsOfTheStudyProgramme')

const creditTableContents = [
...years.map(year => [year, 0, 0, 0, 0, 0]),
Expand All @@ -153,19 +153,19 @@ describe('Studyprogramme overview', () => {
['2017 - 2018', 2350, 2345, 0, 5, 26],
]

cy.checkTableStats(creditTableContents, 'CreditsProducedByTheStudyprogramme')
cy.checkTableStats(creditTableContents, 'CreditsProducedByTheStudyProgramme')
cy.get('[data-cy=YearToggle]').click()
})

it('Basic information graphs render', () => {
cy.get('[data-cy=Graph-StudentsOfTheStudyprogramme')
cy.get('[data-cy=Graph-StudentsOfTheStudyProgramme')
.should('contain', 'Started studying')
.should('contain', 'Accepted')
.should('contain', 'Graduated')
.should('contain', 'Transferred away')
.should('contain', 'Transferred to')

cy.get('[data-cy=Graph-CreditsProducedByTheStudyprogramme')
cy.get('[data-cy=Graph-CreditsProducedByTheStudyProgramme')
.should('contain', 'Degree students')
.should('contain', 'Transferred')
.should('contain', 5796)
Expand Down Expand Up @@ -210,7 +210,7 @@ describe('Studyprogramme overview', () => {

cy.get('[data-cy=GraduationTimeToggle]').click()
cy.get('[data-cy=graduation-times-graphMaster]').within(() => {
cy.contains('Master studyright')
cy.contains('Master study right')
cy.contains('Graduation year')
cy.contains('2021')
cy.contains('2 graduated').trigger('mouseover')
Expand All @@ -222,7 +222,7 @@ describe('Studyprogramme overview', () => {
})

cy.get('[data-cy=graduation-times-graphBachelor]').within(() => {
cy.contains('Bachelor + master studyright')
cy.contains('Bachelor + master study right')
cy.contains('Graduation year')
cy.contains('2023')
cy.contains('11 graduated').trigger('mouseover')
Expand All @@ -235,22 +235,22 @@ describe('Studyprogramme overview', () => {
})
})

/* Studytrack overview -tests */
describe('Studytrack overview works for basic user', () => {
/* Study track overview tests */
describe('Study track overview works for basic user', () => {
beforeEach(() => {
cy.init('/study-programme')
cy.contains('a', 'Matemaattisten tieteiden kandiohjelma').click()
cy.get('.attached').contains('Studytracks and class statistics').click()
cy.get('.attached').contains('Study tracks and class statistics').click()
})

// If the backend breaks for one of the sections, the section header is not rendered and this will fail
it('Studytracks and class statistics -tab loads', () => {
cy.get('[data-cy=Section-StudytrackOverview]')
cy.get('[data-cy=Section-StudytrackProgress]')
cy.get('[data-cy=Section-AverageGraduationTimesStudytracks]')
it('Study tracks and class statistics -tab loads', () => {
cy.get('[data-cy=Section-StudyTrackOverview]')
cy.get('[data-cy=Section-StudyTrackProgress]')
cy.get('[data-cy=Section-AverageGraduationTimesStudyTracks]')
})

it('Students of the studyprogramme are shown correctly', () => {
it('Students of the study programme are shown correctly', () => {
const tableContents = [
// [Year, All, Started studying, Present, Absent, Inactive, Graduated, Men, Women, Other/Unknown, Finland, Other]
['2023 - 2024', 8, 8, 0, 0, 8, 0, 5, 3, 0, 8, 0],
Expand All @@ -263,11 +263,11 @@ describe('Studyprogramme overview', () => {
['Total', 229, 197, 0, 0, 95, 134, 147, 82, 0, 222, 7],
]

cy.checkTableStats(tableContents, 'StudytrackOverview')
cy.checkTableStats(tableContents, 'StudyTrackOverview')
})

it('Years in the students table can be expanded and study track data will be shown', () => {
cy.get('[data-cy=Table-StudytrackOverview]').within(() => {
cy.get('[data-cy=Table-StudyTrackOverview]').within(() => {
cy.get('tbody tr.header-row')
.eq(3)
.within(() => {
Expand Down Expand Up @@ -302,7 +302,7 @@ describe('Studyprogramme overview', () => {
})

it('Links to class statistics page work', () => {
cy.get('[data-cy=Table-StudytrackOverview]').within(() => {
cy.get('[data-cy=Table-StudyTrackOverview]').within(() => {
cy.get('tbody tr.header-row')
.eq(1)
.within(() => {
Expand All @@ -315,7 +315,7 @@ describe('Studyprogramme overview', () => {
})

it('Links to class statistics page with all years combined work', { retries: 2 }, () => {
cy.get('[data-cy=Table-StudytrackOverview]').within(() => {
cy.get('[data-cy=Table-StudyTrackOverview]').within(() => {
cy.get('td.total-row-cell a').click()
})

Expand All @@ -324,7 +324,7 @@ describe('Studyprogramme overview', () => {
})

it('Links to class statistics page with study track info included work', () => {
cy.get('[data-cy=Table-StudytrackOverview]').within(() => {
cy.get('[data-cy=Table-StudyTrackOverview]').within(() => {
cy.get('tbody tr.header-row')
.eq(3)
.within(() => {
Expand Down Expand Up @@ -357,17 +357,17 @@ describe('Studyprogramme overview', () => {
['Total', 229, 28, 18, 24, 21, 10, 14, 114],
]

cy.checkTableStats(tableContents, 'StudytrackProgress')
cy.checkTableStats(tableContents, 'StudyTrackProgress')
})

it('Studytrack overview graphs render', () => {
cy.get('[data-cy=Graph-StudytrackProgress]')
it('Study track overview graphs render', () => {
cy.get('[data-cy=Graph-StudyTrackProgress]')
.should('contain', 'Less than 30 credits')
.should('contain', '30–60 credits')
.should('contain', 'At least 180 credits')
.should('contain', '49.8%') // The percentage for total, at least 180 credits, to check that the graph renders

cy.get('[data-cy=Graph-StudytrackProgress]').contains('49.8%').trigger('mouseover', { force: true })
cy.get('[data-cy=Graph-StudyTrackProgress]').contains('49.8%').trigger('mouseover', { force: true })
cy.contains('At least 180 credits: 114')

cy.get("[data-cy='Section-KH50_001']").within(() => {
Expand Down Expand Up @@ -399,14 +399,16 @@ describe('Studyprogramme overview', () => {
})
})

describe('Studytrack can be changed', () => {
describe('Study track can be changed', () => {
beforeEach(() => {
cy.get('.studytrack-selector').contains('All students of the programme, KH50_001').click()
cy.get('.studytrack-selector .visible.menu').contains('Matematiikka, MAT-MAT').click()
})

it('Students of the study track are shown correctly', () => {
cy.get("[data-cy='Section-StudytrackOverview']").contains('Students of the studytrack MAT-MAT by starting year')
cy.get("[data-cy='Section-StudyTrackOverview']").contains(
'Students of the study track MAT-MAT by starting year'
)
const tableContents = [
// [Year, All, Started studying, Present, Absent, Inactive, Graduated, Men, Women, Other/Unknown, Finland, Other]
['2022 - 2023', 3, 3, 0, 0, 1, 2, 2, 1, 0, 3, 0],
Expand All @@ -417,11 +419,11 @@ describe('Studyprogramme overview', () => {
['2017 - 2018', 28, 24, 0, 0, 1, 27, 15, 13, 0, 28, 0],
['Total', 89, 73, 0, 0, 6, 83, 48, 41, 0, 87, 2],
]
cy.checkTableStats(tableContents, 'StudytrackOverview')
cy.checkTableStats(tableContents, 'StudyTrackOverview')
})

it('Links to class statistics page with study track info included work', () => {
cy.get('[data-cy=Table-StudytrackOverview]').within(() => {
cy.get('[data-cy=Table-StudyTrackOverview]').within(() => {
cy.get('tbody tr.regular-row')
.eq(2)
.within(() => {
Expand All @@ -436,15 +438,15 @@ describe('Studyprogramme overview', () => {
})

it('Info message about missing progress stats is displayed', () => {
cy.contains('.divider', 'Progress of students of the studytrack MAT-MAT by starting year')
cy.contains('.divider', 'Progress of students of the study track MAT-MAT by starting year')
cy.contains(
'.message',
'Currently progress data is only available for all students of the study programme. Please select ”All students of the programme” to view the progress data.'
)
})

it('Average graduation times are displayed correctly', () => {
cy.get("[data-cy='Section-AverageGraduationTimesStudytracks']")
cy.get("[data-cy='Section-AverageGraduationTimesStudyTracks']")
cy.get("[data-cy='graduation-times-graph-breakdownBachelor']").within(() => {
cy.contains('Start year')
cy.contains('2020 - 2021')
Expand Down Expand Up @@ -764,7 +766,7 @@ describe('Studyprogramme overview', () => {

it('can access programme and correct tabs are visible', () => {
cy.contains('Basic information')
cy.contains('Studytracks and class statistics')
cy.contains('Study tracks and class statistics')

cy.contains('Update statistics').should('not.exist')
cy.contains('Degree courses').should('not.exist')
Expand All @@ -773,19 +775,19 @@ describe('Studyprogramme overview', () => {
it('can access basic information', () => {
cy.contains('Basic information').click()

cy.get('[data-cy=Section-StudentsOfTheStudyprogramme]')
cy.get('[data-cy=Section-CreditsProducedByTheStudyprogramme]')
cy.get('[data-cy=Section-StudentsOfTheStudyProgramme]')
cy.get('[data-cy=Section-CreditsProducedByTheStudyProgramme]')
cy.get('[data-cy=Section-GraduatedAndThesisWritersOfTheProgramme]')
cy.get('[data-cy=Section-ProgrammesBeforeOrAfter]')
cy.get('[data-cy=Section-AverageGraduationTimes]')
})

it('can access studytracks', () => {
cy.get('.attached').contains('Studytracks and class statistics').click()
it('can access study tracks', () => {
cy.get('.attached').contains('Study tracks and class statistics').click()

cy.get('[data-cy=Section-StudytrackOverview]')
cy.get('[data-cy=Section-StudytrackProgress]')
cy.get('[data-cy=Section-AverageGraduationTimesStudytracks]')
cy.get('[data-cy=Section-StudyTrackOverview]')
cy.get('[data-cy=Section-StudyTrackProgress]')
cy.get('[data-cy=Section-AverageGraduationTimesStudyTracks]')
})

it("doesn't see other tabs", () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ const getMainStatsByTrackAndYear = async (
}
}

// Combines all the data for the Studytracks and class statistics page in study programme overview
// Combines all the data for the Study tracks and class statistics page in study programme overview
// At the moment combined programme is thought to have only one track, the programme itself
export const getStudyTrackStatsForStudyProgramme = async ({
studyProgramme,
Expand Down
6 changes: 3 additions & 3 deletions services/frontend/src/common/InfoToolTips/faculty.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const facultyToolTips = {
- **Master**: Opiskelijat, joiden opiskeluoikeuteen kuuluu **vain** maisterin tutkinnon suoritusoikeus
- **Doctor**: Tohtorin tutkinnon suorittaneet opiskelijat
Valmistumisajoista on **vähennetty lakisääteiset poissaolot**. Luvuissa ei ole mukana opiskelijoita, jotka ovat vaihtaneet koulutuohjelmaa saman opiskeluoikeuden sisällä (pois lukien kandiohjelmasta maisteriohjelmaan siirtyneet). Toisin sanoen luvut vastaavat *Study programme overview* -näkymän lukuja, kun näkymässä on valittuna *Special studyrights excluded*.
Valmistumisajoista on **vähennetty lakisääteiset poissaolot**. Luvuissa ei ole mukana opiskelijoita, jotka ovat vaihtaneet koulutuohjelmaa saman opiskeluoikeuden sisällä (pois lukien kandiohjelmasta maisteriohjelmaan siirtyneet). Toisin sanoen luvut vastaavat *Study programme overview* -näkymän lukuja, kun näkymässä on valittuna *Special study rights excluded*.
- **Breakdown**/**Median study times**:
- **Breakdown**: Näyttää, kuinka moni opiskelija valmistui tavoiteajassa (vihreä palkki), 12 kuukauden sisällä tavoiteajasta (keltainen palkki) tai tätä myöhemmin (punainen palkki).
Expand All @@ -61,13 +61,13 @@ export const facultyToolTips = {
`,
}

facultyToolTips.StudentsStatsOfTheFaculty = studyProgrammeToolTips.StudytrackOverview.replace(
facultyToolTips.StudentsStatsOfTheFaculty = studyProgrammeToolTips.StudyTrackOverview.replace(
'Yläosan valikosta on mahdollista valita tarkasteluun yhden opintosuunnan opiskelijat. Luvut kuvaavat tällöin kyseisen opintosuunnan opiskelijoita.',
''
)
facultyToolTips.StudentsOfTheFaculty =
'Taulukon luvut on laskettu **yhdistämällä** tiedekunnan koulutusohjelmien luvut. Näin ollen tämän näkymän luvut täsmäävät *Study programme* -näkymän lukuihin. Kategorioiden merkitykset ovat seuraavat:\n'
.concat(studyProgrammeToolTips.StudentsOfTheStudyprogramme)
.concat(studyProgrammeToolTips.StudentsOfTheStudyProgramme)
.replace('Transferred away', 'Transferred out of programme')
.replace('Transferred to', 'Transferred into programme')
facultyToolTips.GraduatedToggle = studyProgrammeToolTips.GraduatedToggle
Expand Down
Loading

0 comments on commit 34a479c

Please sign in to comment.