Skip to content

Commit

Permalink
[Filters] Fix programme filter
Browse files Browse the repository at this point in the history
  • Loading branch information
valtterikantanen committed Aug 23, 2024
1 parent dccef76 commit 54728c3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
4 changes: 2 additions & 2 deletions cypress/e2e/Filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ describe('Course Statistics', () => {
it('Programme filter works', () => {
runTestStepWithPreAndPostParts('Programme', () => {
const card = cy.cs('Programme-filter-card')
const programmeDropdown = card.cs('Programme-filter-dropdown').selectFromDropdown(1)
const programmeDropdown = card.cs('Programme-filter-dropdown').selectFromDropdown(2)
checkFilteringResult(116)
programmeDropdown.get('i.delete').click()
})
Expand Down Expand Up @@ -367,7 +367,7 @@ describe('Custom Population Statistics', () => {
it('Programme filter works', () => {
runTestStepWithPreAndPostParts('Programme', () => {
const card = cy.cs('Programme-filter-card')
const programmeDropdown = card.cs('Programme-filter-dropdown').selectFromDropdown(0)
const programmeDropdown = card.cs('Programme-filter-dropdown').selectFromDropdown(1)
checkFilteringResult(3)
programmeDropdown.get('i.delete').click()
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,9 @@ const ProgrammeFilterCard = ({ additionalModes, onOptionsChange, options, studen
}

const getStudentProgrammes = student =>
(student?.studyRights ?? [])
.flatMap(studyRight =>
studyRight.studyRightElements.map(element => ({ ...element, cancelled: studyRight.cancelled }))
)
.filter(element => element.degreeProgrammeType != null)
(student?.studyRights ?? []).flatMap(studyRight =>
studyRight.studyRightElements.map(element => ({ ...element, cancelled: studyRight.cancelled }))
)

const createStudentToProgrammeMap = (students, studyRightPredicate) => {
const studentToProgrammeMap = {}
Expand Down

0 comments on commit 54728c3

Please sign in to comment.