@studyportals/fawkes 8.7.0 → 8.7.1-0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/organisations-seo/index.d.ts +3 -3
- package/dist/organisations-seo/index.js +1 -1
- package/dist/programmes-seo/index.d.ts +5 -5
- package/dist/programmes-seo/index.js +1 -1
- package/dist/scholarships-seo/index.d.ts +4 -4
- package/dist/scholarships-seo/index.js +2 -2
- package/dist/sitemap-generator-seo/index.d.ts +14 -14
- package/dist/sitemap-generator-seo/index.js +5 -5
- package/dist/src/common/IDependencies.d.ts +1 -1
- package/dist/src/common/IPresenter.d.ts +1 -1
- package/dist/src/common/ISearchDependencies.d.ts +1 -1
- package/dist/src/common/ISeoDependencies.d.ts +2 -2
- package/dist/src/common/ISitemapDependencies.d.ts +2 -2
- package/dist/src/common/ISitemapUrlGenerator.d.ts +1 -1
- package/dist/src/common/policies/BaseSeoIndexabilityPolicy.d.ts +1 -1
- package/dist/src/common/policies/BaseSeoIndexabilityPolicy.js +2 -2
- package/dist/src/common/rules/NoFiltersSelectedRule.d.ts +2 -2
- package/dist/src/common/rules/OnlineAttendanceRule.d.ts +1 -1
- package/dist/src/common/rules/OnlineAttendanceRule.js +1 -1
- package/dist/src/common/rules/OnlyFiltersSelectedRule.d.ts +2 -2
- package/dist/src/common/rules/SingleValueSelectedForFilterRule.d.ts +2 -2
- package/dist/src/organisations/IOrganisationSearchApplicationState.d.ts +1 -1
- package/dist/src/organisations/ISeoSortingState.d.ts +1 -1
- package/dist/src/organisations/SearchIndexabilityManager.d.ts +4 -4
- package/dist/src/organisations/SearchIndexabilityManager.js +2 -2
- package/dist/src/organisations/policies/OrganisationsSeoIndexabilityPolicy.d.ts +3 -3
- package/dist/src/organisations/policies/OrganisationsSeoIndexabilityPolicy.js +3 -3
- package/dist/src/organisations/policies/RankedOrganisationsSeoIndexabilityPolicy.d.ts +1 -1
- package/dist/src/organisations/policies/RankedOrganisationsSeoIndexabilityPolicy.js +1 -1
- package/dist/src/organisations/policies/our-picks/Area.d.ts +5 -5
- package/dist/src/organisations/policies/our-picks/Area.js +6 -6
- package/dist/src/organisations/policies/our-picks/AreaAttendance.d.ts +7 -7
- package/dist/src/organisations/policies/our-picks/AreaAttendance.js +9 -9
- package/dist/src/organisations/policies/our-picks/Attendance.d.ts +6 -6
- package/dist/src/organisations/policies/our-picks/Attendance.js +7 -7
- package/dist/src/organisations/policies/our-picks/Continent.d.ts +5 -5
- package/dist/src/organisations/policies/our-picks/Continent.js +6 -6
- package/dist/src/organisations/policies/our-picks/Country.d.ts +5 -5
- package/dist/src/organisations/policies/our-picks/Country.js +6 -6
- package/dist/src/organisations/policies/our-picks/CountryAreaCity.d.ts +6 -6
- package/dist/src/organisations/policies/our-picks/CountryAreaCity.js +7 -7
- package/dist/src/organisations/policies/our-picks/CountryAttendance.d.ts +7 -7
- package/dist/src/organisations/policies/our-picks/CountryAttendance.js +9 -9
- package/dist/src/organisations/policies/our-picks/CountryCity.d.ts +6 -6
- package/dist/src/organisations/policies/our-picks/CountryCity.js +7 -7
- package/dist/src/organisations/policies/our-picks/Unfiltered.d.ts +4 -4
- package/dist/src/organisations/policies/our-picks/Unfiltered.js +4 -4
- package/dist/src/organisations/policies/ranked/RankedArea.d.ts +4 -4
- package/dist/src/organisations/policies/ranked/RankedArea.js +4 -4
- package/dist/src/organisations/policies/ranked/RankedAreaDiscipline.d.ts +5 -5
- package/dist/src/organisations/policies/ranked/RankedAreaDiscipline.js +6 -6
- package/dist/src/organisations/policies/ranked/RankedAttendance.d.ts +5 -5
- package/dist/src/organisations/policies/ranked/RankedAttendance.js +5 -5
- package/dist/src/organisations/policies/ranked/RankedAttendanceDiscipline.d.ts +5 -5
- package/dist/src/organisations/policies/ranked/RankedAttendanceDiscipline.js +6 -6
- package/dist/src/organisations/policies/ranked/RankedContinent.d.ts +4 -4
- package/dist/src/organisations/policies/ranked/RankedContinent.js +4 -4
- package/dist/src/organisations/policies/ranked/RankedContinentAttendance.d.ts +6 -6
- package/dist/src/organisations/policies/ranked/RankedContinentAttendance.js +7 -7
- package/dist/src/organisations/policies/ranked/RankedCountry.d.ts +4 -4
- package/dist/src/organisations/policies/ranked/RankedCountry.js +4 -4
- package/dist/src/organisations/policies/ranked/RankedCountryAttendance.d.ts +5 -5
- package/dist/src/organisations/policies/ranked/RankedCountryAttendance.js +6 -6
- package/dist/src/organisations/policies/ranked/RankedCountryDiscipline.d.ts +4 -4
- package/dist/src/organisations/policies/ranked/RankedCountryDiscipline.js +5 -5
- package/dist/src/organisations/policies/ranked/RankedDiscipline.d.ts +4 -4
- package/dist/src/organisations/policies/ranked/RankedDiscipline.js +4 -4
- package/dist/src/organisations/policies/ranked/RankedUnfiltered.d.ts +3 -3
- package/dist/src/organisations/policies/ranked/RankedUnfiltered.js +2 -2
- package/dist/src/organisations/rules/BaseSearchVolumeOrganisationsRule.d.ts +3 -3
- package/dist/src/organisations/rules/ContinentIsEuropeRule.d.ts +1 -1
- package/dist/src/organisations/rules/ContinentIsEuropeRule.js +1 -1
- package/dist/src/organisations/rules/ExcludeByIdForCitiesRule.d.ts +3 -3
- package/dist/src/organisations/rules/MinimumAmountOfRankedResultsRule.d.ts +3 -3
- package/dist/src/organisations/rules/MinimumAmountOfRankedResultsRule.js +1 -1
- package/dist/src/organisations/rules/MinimumAmountOfResultsRule.d.ts +4 -4
- package/dist/src/organisations/rules/MinimumAmountOfResultsRule.js +1 -1
- package/dist/src/organisations/rules/NoFiltersSelectedRule.d.ts +2 -2
- package/dist/src/organisations/types/IOrganisationSearchDependencies.d.ts +2 -2
- package/dist/src/organisations/types/IOrganisationsSitemapDependencies.d.ts +3 -3
- package/dist/src/presenters/AreaPresenter.d.ts +1 -1
- package/dist/src/presenters/AttendancePresenter.d.ts +1 -1
- package/dist/src/presenters/CityPresenter.d.ts +1 -1
- package/dist/src/presenters/ContinentPresenter.d.ts +1 -1
- package/dist/src/presenters/CountryPresenter.d.ts +1 -1
- package/dist/src/presenters/DegreePresenter.d.ts +1 -1
- package/dist/src/presenters/DisciplinePresenter.d.ts +1 -1
- package/dist/src/presenters/DurationPresenter.d.ts +1 -1
- package/dist/src/presenters/EducationalFormPresenter.d.ts +1 -1
- package/dist/src/presenters/FormatPresenter.d.ts +1 -1
- package/dist/src/presenters/SpecialProgrammesPresenter.d.ts +1 -1
- package/dist/src/presenters/TuitionFeePresenter.d.ts +1 -1
- package/dist/src/programmes/BaseProgrammeFilterKeyValueRule.d.ts +2 -2
- package/dist/src/programmes/BaseProgrammeFilterKeyValueRule.js +1 -1
- package/dist/src/programmes/BaseProgrammeRule.d.ts +2 -2
- package/dist/src/programmes/IProgrammeRule.d.ts +2 -2
- package/dist/src/programmes/ProgrammesBaseIndexabilityPolicy.d.ts +3 -3
- package/dist/src/programmes/ProgrammesBaseIndexabilityPolicy.js +1 -1
- package/dist/src/programmes/SearchIndexabilityManager.d.ts +4 -4
- package/dist/src/programmes/SearchIndexabilityManager.js +8 -4
- package/dist/src/programmes/policies/Area.d.ts +3 -3
- package/dist/src/programmes/policies/Area.js +4 -4
- package/dist/src/programmes/policies/Attendance.d.ts +4 -4
- package/dist/src/programmes/policies/Attendance.js +5 -5
- package/dist/src/programmes/policies/AttendanceArea.d.ts +4 -4
- package/dist/src/programmes/policies/AttendanceArea.js +6 -6
- package/dist/src/programmes/policies/AttendanceContinent.d.ts +4 -4
- package/dist/src/programmes/policies/AttendanceContinent.js +6 -6
- package/dist/src/programmes/policies/AttendanceDegree.d.ts +2 -2
- package/dist/src/programmes/policies/AttendanceDegree.js +5 -5
- package/dist/src/programmes/policies/AttendanceDuration.d.ts +5 -5
- package/dist/src/programmes/policies/AttendanceDuration.js +7 -7
- package/dist/src/programmes/policies/AttendanceFormat.d.ts +4 -4
- package/dist/src/programmes/policies/AttendanceFormat.js +6 -6
- package/dist/src/programmes/policies/Continent.d.ts +3 -3
- package/dist/src/programmes/policies/Continent.js +4 -4
- package/dist/src/programmes/policies/ContinentDuration.d.ts +3 -3
- package/dist/src/programmes/policies/ContinentDuration.js +5 -5
- package/dist/src/programmes/policies/ContinentFormat.d.ts +3 -3
- package/dist/src/programmes/policies/ContinentFormat.js +5 -5
- package/dist/src/programmes/policies/ContinentSpecialProgrammes.d.ts +4 -4
- package/dist/src/programmes/policies/ContinentSpecialProgrammes.js +6 -6
- package/dist/src/programmes/policies/Country.d.ts +3 -3
- package/dist/src/programmes/policies/Country.js +4 -4
- package/dist/src/programmes/policies/CountryAttendance.d.ts +4 -4
- package/dist/src/programmes/policies/CountryAttendance.js +6 -6
- package/dist/src/programmes/policies/CountryAttendanceDegree.d.ts +4 -4
- package/dist/src/programmes/policies/CountryAttendanceDegree.js +7 -7
- package/dist/src/programmes/policies/CountryDegree.d.ts +2 -2
- package/dist/src/programmes/policies/CountryDegree.js +5 -5
- package/dist/src/programmes/policies/CountryDuration.d.ts +3 -3
- package/dist/src/programmes/policies/CountryDuration.js +5 -5
- package/dist/src/programmes/policies/CountryDurationDegree.d.ts +3 -3
- package/dist/src/programmes/policies/CountryDurationDegree.js +6 -6
- package/dist/src/programmes/policies/CountryEducationalForm.d.ts +2 -2
- package/dist/src/programmes/policies/CountryEducationalForm.js +5 -5
- package/dist/src/programmes/policies/CountryFormat.d.ts +3 -3
- package/dist/src/programmes/policies/CountryFormat.js +5 -5
- package/dist/src/programmes/policies/CountrySpecialProgrammes.d.ts +4 -4
- package/dist/src/programmes/policies/CountrySpecialProgrammes.js +6 -6
- package/dist/src/programmes/policies/Degree.d.ts +3 -3
- package/dist/src/programmes/policies/Degree.js +4 -4
- package/dist/src/programmes/policies/DegreeArea.d.ts +3 -3
- package/dist/src/programmes/policies/DegreeArea.js +5 -5
- package/dist/src/programmes/policies/DegreeAttendanceDiscipline.d.ts +4 -4
- package/dist/src/programmes/policies/DegreeAttendanceDiscipline.js +7 -7
- package/dist/src/programmes/policies/DegreeAttendanceFormat.d.ts +4 -4
- package/dist/src/programmes/policies/DegreeAttendanceFormat.js +7 -7
- package/dist/src/programmes/policies/DegreeAttendanceSpecialProgrammes.d.ts +4 -4
- package/dist/src/programmes/policies/DegreeAttendanceSpecialProgrammes.js +7 -7
- package/dist/src/programmes/policies/DegreeContinent.d.ts +2 -2
- package/dist/src/programmes/policies/DegreeContinent.js +5 -5
- package/dist/src/programmes/policies/DegreeCountryAttendance.d.ts +3 -3
- package/dist/src/programmes/policies/DegreeCountryAttendance.js +6 -6
- package/dist/src/programmes/policies/DegreeCountryDiscipline.d.ts +3 -3
- package/dist/src/programmes/policies/DegreeCountryDiscipline.js +6 -6
- package/dist/src/programmes/policies/DegreeCountryTuitionFee.d.ts +3 -3
- package/dist/src/programmes/policies/DegreeCountryTuitionFee.js +6 -6
- package/dist/src/programmes/policies/DegreeDuration.d.ts +2 -2
- package/dist/src/programmes/policies/DegreeDuration.js +5 -5
- package/dist/src/programmes/policies/DegreeFormat.d.ts +2 -2
- package/dist/src/programmes/policies/DegreeFormat.js +5 -5
- package/dist/src/programmes/policies/DegreeSpecialProgrammes.d.ts +3 -3
- package/dist/src/programmes/policies/DegreeSpecialProgrammes.js +5 -5
- package/dist/src/programmes/policies/DegreeTuitionFee.d.ts +3 -3
- package/dist/src/programmes/policies/DegreeTuitionFee.js +5 -5
- package/dist/src/programmes/policies/{DisciplineTuitionFee.d.ts → DegreeTuitionFeeArea.d.ts} +5 -5
- package/dist/src/programmes/policies/{DegreeAreaTuitionFee.js → DegreeTuitionFeeArea.js} +7 -7
- package/dist/src/programmes/policies/{DegreeAttendanceTuitionFee.d.ts → DegreeTuitionFeeAttendance.d.ts} +2 -2
- package/dist/src/programmes/policies/{DegreeAttendanceTuitionFee.js → DegreeTuitionFeeAttendance.js} +7 -7
- package/dist/src/programmes/policies/{DegreeContinentTuitionFee.d.ts → DegreeTuitionFeeContinent.d.ts} +2 -2
- package/dist/src/programmes/policies/{DegreeContinentTuitionFee.js → DegreeTuitionFeeContinent.js} +6 -6
- package/dist/src/programmes/policies/{DegreeFormatTuitionFee.d.ts → DegreeTuitionFeeFormat.d.ts} +3 -3
- package/dist/src/programmes/policies/{DegreeFormatTuitionFee.js → DegreeTuitionFeeFormat.js} +9 -9
- package/dist/src/programmes/policies/Discipline.d.ts +3 -3
- package/dist/src/programmes/policies/Discipline.js +4 -4
- package/dist/src/programmes/policies/DisciplineAttendance.d.ts +4 -4
- package/dist/src/programmes/policies/DisciplineAttendance.js +6 -6
- package/dist/src/programmes/policies/DisciplineContinent.d.ts +3 -3
- package/dist/src/programmes/policies/DisciplineContinent.js +5 -5
- package/dist/src/programmes/policies/DisciplineContinentAttendance.d.ts +4 -4
- package/dist/src/programmes/policies/DisciplineContinentAttendance.js +7 -7
- package/dist/src/programmes/policies/DisciplineCountry.d.ts +3 -3
- package/dist/src/programmes/policies/DisciplineCountry.js +5 -5
- package/dist/src/programmes/policies/DisciplineCountryAttendance.d.ts +4 -4
- package/dist/src/programmes/policies/DisciplineCountryAttendance.js +7 -7
- package/dist/src/programmes/policies/DisciplineCountryEducationalForm.d.ts +2 -2
- package/dist/src/programmes/policies/DisciplineCountryEducationalForm.js +6 -6
- package/dist/src/programmes/policies/DisciplineCountryFormat.d.ts +3 -3
- package/dist/src/programmes/policies/DisciplineCountryFormat.js +6 -6
- package/dist/src/programmes/policies/DisciplineDegree.d.ts +3 -3
- package/dist/src/programmes/policies/DisciplineDegree.js +5 -5
- package/dist/src/programmes/policies/DisciplineDuration.d.ts +3 -3
- package/dist/src/programmes/policies/DisciplineDuration.js +5 -5
- package/dist/src/programmes/policies/DisciplineEducationalForm.d.ts +2 -2
- package/dist/src/programmes/policies/DisciplineEducationalForm.js +5 -5
- package/dist/src/programmes/policies/DisciplineFormat.d.ts +3 -3
- package/dist/src/programmes/policies/DisciplineFormat.js +5 -5
- package/dist/src/programmes/policies/DisciplineSpecialProgrammes.d.ts +3 -3
- package/dist/src/programmes/policies/DisciplineSpecialProgrammes.js +5 -5
- package/dist/src/programmes/policies/Duration.d.ts +3 -3
- package/dist/src/programmes/policies/Duration.js +4 -4
- package/dist/src/programmes/policies/Format.d.ts +3 -3
- package/dist/src/programmes/policies/Format.js +4 -4
- package/dist/src/programmes/policies/SpecialProgrammes.d.ts +3 -3
- package/dist/src/programmes/policies/SpecialProgrammes.js +4 -4
- package/dist/src/programmes/policies/TuitionFee.d.ts +3 -3
- package/dist/src/programmes/policies/TuitionFee.js +4 -4
- package/dist/src/programmes/policies/TuitionFeeAttendance.d.ts +4 -4
- package/dist/src/programmes/policies/TuitionFeeAttendance.js +6 -6
- package/dist/src/programmes/policies/TuitionFeeAttendanceDiscipline.d.ts +4 -4
- package/dist/src/programmes/policies/TuitionFeeAttendanceDiscipline.js +7 -7
- package/dist/src/programmes/policies/TuitionFeeContinent.d.ts +3 -3
- package/dist/src/programmes/policies/TuitionFeeContinent.js +5 -5
- package/dist/src/programmes/policies/TuitionFeeCountry.d.ts +3 -3
- package/dist/src/programmes/policies/TuitionFeeCountry.js +5 -5
- package/dist/src/programmes/policies/TuitionFeeDiscipline.d.ts +3 -3
- package/dist/src/programmes/policies/TuitionFeeDiscipline.js +5 -5
- package/dist/src/programmes/policies/Unfiltered.d.ts +2 -2
- package/dist/src/programmes/policies/Unfiltered.js +2 -2
- package/dist/src/programmes/policies/index.d.ts +4 -5
- package/dist/src/programmes/policies/index.js +4 -5
- package/dist/src/programmes/rules/DegreeAttendanceDisciplineRule.d.ts +2 -2
- package/dist/src/programmes/rules/DegreeAttendanceDisciplineSpecificRule.d.ts +2 -2
- package/dist/src/programmes/rules/DegreeCountryAttendanceSpecificRule.d.ts +2 -2
- package/dist/src/programmes/rules/DegreeCountryDisciplineSpecificRule.d.ts +2 -2
- package/dist/src/programmes/rules/DegreeCountryTuitionFeeSpecificRule.d.ts +2 -2
- package/dist/src/programmes/rules/DegreeDisciplineRule.d.ts +2 -2
- package/dist/src/programmes/rules/IndexableDegreeRule.d.ts +2 -2
- package/dist/src/programmes/rules/IndexableDegreeRule.js +1 -1
- package/dist/src/programmes/rules/IndexableDurationRule.d.ts +2 -2
- package/dist/src/programmes/rules/IndexableDurationRule.js +1 -1
- package/dist/src/programmes/rules/IndexableEducationalFormRule.d.ts +2 -2
- package/dist/src/programmes/rules/IndexableEducationalFormRule.js +1 -1
- package/dist/src/programmes/rules/IndexablePageNumberRule.js +1 -1
- package/dist/src/programmes/rules/MbaOrMscDegreeRule.d.ts +2 -2
- package/dist/src/programmes/rules/MinimumAmountOfResultsRule.d.ts +3 -3
- package/dist/src/programmes/rules/MinimumAmountOfResultsRule.js +1 -1
- package/dist/src/programmes/rules/NotDistanceLearningPortalRule.js +1 -1
- package/dist/src/programmes/rules/OneYearOnlyRule.d.ts +2 -2
- package/dist/src/programmes/types/IProgrammeSearchApplicationState.d.ts +1 -1
- package/dist/src/programmes/types/IProgrammeSearchDependencies.d.ts +1 -1
- package/dist/src/programmes/types/IProgrammeSearchSitemapDependencies.d.ts +1 -1
- package/dist/src/programmes/types/IProgrammeSitemapDependencies.d.ts +2 -2
- package/dist/src/programmes/types/IProgrammeSitemapUrlGenerator.d.ts +1 -1
- package/dist/src/scholarships/SearchIndexabilityManager.d.ts +5 -5
- package/dist/src/scholarships/SearchIndexabilityManager.js +1 -1
- package/dist/src/scholarships/policies/Area.d.ts +3 -3
- package/dist/src/scholarships/policies/Area.js +4 -4
- package/dist/src/scholarships/policies/Country.d.ts +3 -3
- package/dist/src/scholarships/policies/Country.js +4 -4
- package/dist/src/scholarships/policies/Discipline.d.ts +4 -4
- package/dist/src/scholarships/policies/Discipline.js +5 -5
- package/dist/src/scholarships/policies/DisciplineCountry.d.ts +3 -3
- package/dist/src/scholarships/policies/DisciplineCountry.js +5 -5
- package/dist/src/scholarships/policies/ScholarshipSeoIndexabilityPolicy.d.ts +2 -2
- package/dist/src/scholarships/policies/ScholarshipSeoIndexabilityPolicy.js +2 -2
- package/dist/src/scholarships/policies/Unfiltered.d.ts +2 -2
- package/dist/src/scholarships/policies/Unfiltered.js +2 -2
- package/dist/src/scholarships/policies/UniversityCountry.d.ts +3 -3
- package/dist/src/scholarships/policies/UniversityCountry.js +4 -4
- package/dist/src/scholarships/rules/ExceptAustaliaAreasRule.d.ts +3 -3
- package/dist/src/scholarships/rules/ExceptAustaliaAreasRule.js +1 -1
- package/dist/src/scholarships/rules/SearchVolumeAreasRule.d.ts +3 -3
- package/dist/src/scholarships/rules/SearchVolumeCountriesDisciplinesRule.d.ts +3 -3
- package/dist/src/scholarships/rules/SearchVolumeCountriesRule.d.ts +3 -3
- package/dist/src/scholarships/rules/SearchVolumeDisciplinesRule.d.ts +3 -3
- package/dist/src/scholarships/types/IScholarshipSeoDependencies.d.ts +1 -1
- package/dist/src/scholarships/types/IScholarshipSitemapDependencies.d.ts +2 -2
- package/dist/src/sitemap-generator/BaseSitemapUrlGeneratorManager.d.ts +3 -3
- package/dist/src/sitemap-generator/IRankingApiClient.d.ts +1 -1
- package/dist/src/sitemap-generator/ISearchApiClient.d.ts +1 -1
- package/dist/src/sitemap-generator/ISitemapUrlGeneratorManager.d.ts +3 -3
- package/dist/src/sitemap-generator/OrganisationsSitemapUrlGeneratorManager.d.ts +4 -4
- package/dist/src/sitemap-generator/OrganisationsSitemapUrlGeneratorManager.js +8 -8
- package/dist/src/sitemap-generator/ProgrammesSitemapUrlGeneratorManager.d.ts +3 -3
- package/dist/src/sitemap-generator/ProgrammesSitemapUrlGeneratorManager.js +15 -15
- package/dist/src/sitemap-generator/ScholarshipsSitemapUrlGeneratorManager.d.ts +3 -3
- package/dist/src/sitemap-generator/ScholarshipsSitemapUrlGeneratorManager.js +7 -7
- package/dist/src/structured-data/OrganisationStructuredDataFactory.d.ts +1 -1
- package/dist/src/structured-data/ProgrammeStructuredDataFactory.d.ts +1 -1
- package/dist/tests/common/rules/NoFiltersSelectedRule.test.d.mts +1 -0
- package/dist/tests/common/rules/NoFiltersSelectedRule.test.mjs +40 -0
- package/dist/tests/common/rules/OnlyFiltersSelectedRule.test.d.mts +1 -0
- package/dist/tests/common/rules/OnlyFiltersSelectedRule.test.mjs +70 -0
- package/dist/tests/common/rules/SingleValueSelectedForFilterRule.test.d.mts +1 -0
- package/dist/tests/common/rules/SingleValueSelectedForFilterRule.test.mjs +54 -0
- package/dist/tests/organisations/policies/our-picks/Area.test.d.mts +1 -0
- package/dist/tests/organisations/policies/our-picks/Area.test.mjs +125 -0
- package/dist/tests/organisations/policies/our-picks/AreaAttendance.test.d.mts +1 -0
- package/dist/tests/organisations/policies/our-picks/AreaAttendance.test.mjs +238 -0
- package/dist/tests/organisations/policies/our-picks/Attendance.test.d.mts +1 -0
- package/dist/tests/organisations/policies/our-picks/Attendance.test.mjs +119 -0
- package/dist/tests/organisations/policies/our-picks/Continent.test.d.mts +1 -0
- package/dist/tests/organisations/policies/our-picks/Continent.test.mjs +105 -0
- package/dist/tests/organisations/policies/our-picks/Country.test.d.mts +1 -0
- package/dist/tests/organisations/policies/our-picks/Country.test.mjs +109 -0
- package/dist/tests/organisations/policies/our-picks/CountryAreaCity.test.d.mts +1 -0
- package/dist/tests/organisations/policies/our-picks/CountryAreaCity.test.mjs +152 -0
- package/dist/tests/organisations/policies/our-picks/CountryAttendance.test.d.mts +1 -0
- package/dist/tests/organisations/policies/our-picks/CountryAttendance.test.mjs +223 -0
- package/dist/tests/organisations/policies/our-picks/CountryCity.test.d.mts +1 -0
- package/dist/tests/organisations/policies/our-picks/CountryCity.test.mjs +109 -0
- package/dist/tests/organisations/policies/our-picks/Unfiltered.test.d.mts +1 -0
- package/dist/tests/organisations/policies/our-picks/Unfiltered.test.mjs +60 -0
- package/dist/tests/organisations/policies/ranked/RankedArea.test.d.mts +1 -0
- package/dist/tests/organisations/policies/ranked/RankedArea.test.mjs +149 -0
- package/dist/tests/organisations/policies/ranked/RankedAreaDiscipline.test.d.mts +1 -0
- package/dist/tests/organisations/policies/ranked/RankedAreaDiscipline.test.mjs +237 -0
- package/dist/tests/organisations/policies/ranked/RankedAttendance.test.d.mts +1 -0
- package/dist/tests/organisations/policies/ranked/RankedAttendance.test.mjs +139 -0
- package/dist/tests/organisations/policies/ranked/RankedAttendanceDiscipline.test.d.mts +1 -0
- package/dist/tests/organisations/policies/ranked/RankedAttendanceDiscipline.test.mjs +224 -0
- package/dist/tests/organisations/policies/ranked/RankedContinent.test.d.mts +1 -0
- package/dist/tests/organisations/policies/ranked/RankedContinent.test.mjs +125 -0
- package/dist/tests/organisations/policies/ranked/RankedContinentAttendance.test.d.mts +1 -0
- package/dist/tests/organisations/policies/ranked/RankedContinentAttendance.test.mjs +253 -0
- package/dist/tests/organisations/policies/ranked/RankedCountry.test.d.mts +1 -0
- package/dist/tests/organisations/policies/ranked/RankedCountry.test.mjs +131 -0
- package/dist/tests/organisations/policies/ranked/RankedCountryAttendance.test.d.mts +1 -0
- package/dist/tests/organisations/policies/ranked/RankedCountryAttendance.test.mjs +230 -0
- package/dist/tests/organisations/policies/ranked/RankedCountryDiscipline.test.d.mts +1 -0
- package/dist/tests/organisations/policies/ranked/RankedCountryDiscipline.test.mjs +197 -0
- package/dist/tests/organisations/policies/ranked/RankedDiscipline.test.d.mts +1 -0
- package/dist/tests/organisations/policies/ranked/RankedDiscipline.test.mjs +124 -0
- package/dist/tests/organisations/policies/ranked/RankedUnfiltered.test.d.mts +1 -0
- package/dist/tests/organisations/policies/ranked/RankedUnfiltered.test.mjs +75 -0
- package/dist/tests/organisations/rules/ContinentIsEuropeRule.test.d.mts +1 -0
- package/dist/tests/organisations/rules/ContinentIsEuropeRule.test.mjs +59 -0
- package/dist/tests/organisations/rules/MinimumAmountOfRankedResultsRule.test.d.mts +1 -0
- package/dist/tests/organisations/rules/MinimumAmountOfRankedResultsRule.test.mjs +77 -0
- package/dist/tests/organisations/rules/MinimumAmountOfResultsRule.test.d.mts +1 -0
- package/dist/tests/organisations/rules/MinimumAmountOfResultsRule.test.mjs +77 -0
- package/dist/tests/organisations/rules/OnlineAttendanceRule.test.d.mts +1 -0
- package/dist/tests/organisations/rules/OnlineAttendanceRule.test.mjs +59 -0
- package/dist/tests/organisations/rules/SearchVolumeAreasAttendanceRule.test.d.mts +1 -0
- package/dist/tests/organisations/rules/SearchVolumeAreasAttendanceRule.test.mjs +59 -0
- package/dist/tests/organisations/rules/SearchVolumeAreasDisciplineRule.test.d.mts +1 -0
- package/dist/tests/organisations/rules/SearchVolumeAreasDisciplineRule.test.mjs +59 -0
- package/dist/tests/organisations/rules/SearchVolumeCountriesAttendanceRule.test.d.mts +1 -0
- package/dist/tests/organisations/rules/SearchVolumeCountriesAttendanceRule.test.mjs +59 -0
- package/dist/tests/organisations/utils/SearchDependencies.util.d.mts +20 -0
- package/dist/tests/organisations/utils/SearchDependencies.util.mjs +88 -0
- package/dist/tests/organisations/utils/SitemapDependencies.util.d.mts +18 -0
- package/dist/tests/organisations/utils/SitemapDependencies.util.mjs +54 -0
- package/dist/tests/presenters/AreaPresenter.test.d.mts +1 -0
- package/dist/tests/presenters/AreaPresenter.test.mjs +46 -0
- package/dist/tests/presenters/AttendancePresenter.test.d.mts +1 -0
- package/dist/tests/presenters/AttendancePresenter.test.mjs +41 -0
- package/dist/tests/presenters/ContinentPresenter.test.d.mts +1 -0
- package/dist/tests/presenters/ContinentPresenter.test.mjs +44 -0
- package/dist/tests/presenters/CountryPresenter.test.d.mts +1 -0
- package/dist/tests/presenters/CountryPresenter.test.mjs +50 -0
- package/dist/tests/presenters/DegreePresenter.test.d.mts +1 -0
- package/dist/tests/presenters/DegreePresenter.test.mjs +51 -0
- package/dist/tests/presenters/DisciplinePresenter.test.d.mts +1 -0
- package/dist/tests/presenters/DisciplinePresenter.test.mjs +40 -0
- package/dist/tests/presenters/DurationPresenter.test.d.mts +1 -0
- package/dist/tests/presenters/DurationPresenter.test.mjs +64 -0
- package/dist/tests/presenters/EducationalFormPresenter.test.d.mts +1 -0
- package/dist/tests/presenters/EducationalFormPresenter.test.mjs +60 -0
- package/dist/tests/presenters/FormatPresenter.test.d.mts +1 -0
- package/dist/tests/presenters/FormatPresenter.test.mjs +43 -0
- package/dist/tests/presenters/SpecialProgrammesPresenter.test.d.mts +1 -0
- package/dist/tests/presenters/SpecialProgrammesPresenter.test.mjs +66 -0
- package/dist/tests/presenters/TuitionFeePresenter.test.d.mts +1 -0
- package/dist/tests/presenters/TuitionFeePresenter.test.mjs +52 -0
- package/dist/tests/programmes/policies/Area.test.d.mts +1 -0
- package/dist/tests/programmes/policies/Area.test.mjs +153 -0
- package/dist/tests/programmes/policies/Attendance.test.d.mts +1 -0
- package/dist/tests/programmes/policies/Attendance.test.mjs +173 -0
- package/dist/tests/programmes/policies/AttendanceDegree.test.d.mts +1 -0
- package/dist/tests/programmes/policies/AttendanceDegree.test.mjs +291 -0
- package/dist/tests/programmes/policies/Continent.test.d.mts +1 -0
- package/dist/tests/programmes/policies/Continent.test.mjs +169 -0
- package/dist/tests/programmes/policies/Country.test.d.mts +1 -0
- package/dist/tests/programmes/policies/Country.test.mjs +164 -0
- package/dist/tests/programmes/policies/CountryAttendance.test.d.mts +1 -0
- package/dist/tests/programmes/policies/CountryAttendance.test.mjs +251 -0
- package/dist/tests/programmes/policies/CountryAttendanceDegree.test.d.mts +1 -0
- package/dist/tests/programmes/policies/CountryAttendanceDegree.test.mjs +337 -0
- package/dist/tests/programmes/policies/CountryDegree.test.d.mts +1 -0
- package/dist/tests/programmes/policies/CountryDegree.test.mjs +262 -0
- package/dist/tests/programmes/policies/CountryDuration.test.d.mts +1 -0
- package/dist/tests/programmes/policies/CountryDuration.test.mjs +234 -0
- package/dist/tests/programmes/policies/CountryDurationDegree.test.d.mts +1 -0
- package/dist/tests/programmes/policies/CountryDurationDegree.test.mjs +304 -0
- package/dist/tests/programmes/policies/CountryEducationalForm.test.d.mts +1 -0
- package/dist/tests/programmes/policies/CountryEducationalForm.test.mjs +260 -0
- package/dist/tests/programmes/policies/CountryFormat.test.d.mts +1 -0
- package/dist/tests/programmes/policies/CountryFormat.test.mjs +253 -0
- package/dist/tests/programmes/policies/DegreeAttendanceDiscipline.test.d.mts +1 -0
- package/dist/tests/programmes/policies/DegreeAttendanceDiscipline.test.mjs +179 -0
- package/dist/tests/programmes/policies/DegreeCountryAttendance.test.d.mts +1 -0
- package/dist/tests/programmes/policies/DegreeCountryAttendance.test.mjs +267 -0
- package/dist/tests/programmes/policies/DegreeCountryTuitionFee.test.d.mts +1 -0
- package/dist/tests/programmes/policies/DegreeCountryTuitionFee.test.mjs +217 -0
- package/dist/tests/programmes/policies/DegreeFormat.test.d.mts +1 -0
- package/dist/tests/programmes/policies/DegreeFormat.test.mjs +221 -0
- package/dist/tests/programmes/policies/Discipline.test.d.mts +1 -0
- package/dist/tests/programmes/policies/Discipline.test.mjs +159 -0
- package/dist/tests/programmes/policies/DisciplineAttendance.test.d.mts +1 -0
- package/dist/tests/programmes/policies/DisciplineAttendance.test.mjs +292 -0
- package/dist/tests/programmes/policies/DisciplineContinent.test.d.mts +1 -0
- package/dist/tests/programmes/policies/DisciplineContinent.test.mjs +253 -0
- package/dist/tests/programmes/policies/DisciplineCountry.test.d.mts +1 -0
- package/dist/tests/programmes/policies/DisciplineCountry.test.mjs +244 -0
- package/dist/tests/programmes/policies/DisciplineCountryEducationalForm.test.d.mts +1 -0
- package/dist/tests/programmes/policies/DisciplineCountryEducationalForm.test.mjs +345 -0
- package/dist/tests/programmes/policies/DisciplineDegree.test.d.mts +1 -0
- package/dist/tests/programmes/policies/DisciplineDegree.test.mjs +273 -0
- package/dist/tests/programmes/policies/DisciplineDuration.test.d.mts +1 -0
- package/dist/tests/programmes/policies/DisciplineDuration.test.mjs +278 -0
- package/dist/tests/programmes/policies/DisciplineEducationalForm.test.d.mts +1 -0
- package/dist/tests/programmes/policies/DisciplineEducationalForm.test.mjs +302 -0
- package/dist/tests/programmes/policies/DisciplineFormat.test.d.mts +1 -0
- package/dist/tests/programmes/policies/DisciplineFormat.test.mjs +266 -0
- package/dist/tests/programmes/policies/Duration.test.d.mts +1 -0
- package/dist/tests/programmes/policies/Duration.test.mjs +179 -0
- package/dist/tests/programmes/policies/Format.test.d.mts +1 -0
- package/dist/tests/programmes/policies/Format.test.mjs +117 -0
- package/dist/tests/programmes/policies/NewRulesValidation.test.d.mts +1 -0
- package/dist/tests/programmes/policies/NewRulesValidation.test.mjs +320 -0
- package/dist/tests/programmes/policies/SpecialProgrammes.test.d.mts +1 -0
- package/dist/tests/programmes/policies/SpecialProgrammes.test.mjs +171 -0
- package/dist/tests/programmes/policies/TuitionFeeAttendanceDiscipline.test.d.mts +1 -0
- package/dist/tests/programmes/policies/TuitionFeeAttendanceDiscipline.test.mjs +360 -0
- package/dist/tests/programmes/policies/TuitionFeeContinent.test.d.mts +1 -0
- package/dist/tests/programmes/policies/TuitionFeeContinent.test.mjs +293 -0
- package/dist/tests/programmes/policies/TuitionFeeCountry.test.d.mts +1 -0
- package/dist/tests/programmes/policies/TuitionFeeCountry.test.mjs +266 -0
- package/dist/tests/programmes/policies/TuitionFeeDiscipline.test.d.mts +1 -0
- package/dist/tests/programmes/policies/TuitionFeeDiscipline.test.mjs +267 -0
- package/dist/tests/programmes/policies/Unfiltered.test.d.mts +1 -0
- package/dist/tests/programmes/policies/Unfiltered.test.mjs +90 -0
- package/dist/tests/programmes/rules/AffordableTuitionFeeRule.test.d.mts +1 -0
- package/dist/tests/programmes/rules/AffordableTuitionFeeRule.test.mjs +27 -0
- package/dist/tests/programmes/rules/DegreeCountrySpecificRule.test.d.mts +1 -0
- package/dist/tests/programmes/rules/DegreeCountrySpecificRule.test.mjs +121 -0
- package/dist/tests/programmes/rules/DegreeDisciplineRule.test.d.mts +1 -0
- package/dist/tests/programmes/rules/DegreeDisciplineRule.test.mjs +169 -0
- package/dist/tests/programmes/rules/IndexableDegreeRule.test.d.mts +1 -0
- package/dist/tests/programmes/rules/IndexableDegreeRule.test.mjs +101 -0
- package/dist/tests/programmes/rules/IndexableDurationRule.test..d.mts +1 -0
- package/dist/tests/programmes/rules/IndexableDurationRule.test..mjs +25 -0
- package/dist/tests/programmes/rules/IndexableEducationalFormRule.test.d.mts +1 -0
- package/dist/tests/programmes/rules/IndexableEducationalFormRule.test.mjs +27 -0
- package/dist/tests/programmes/rules/IndexablePageNumberRule.test.d.mts +1 -0
- package/dist/tests/programmes/rules/IndexablePageNumberRule.test.mjs +51 -0
- package/dist/tests/programmes/rules/MbaDegreeRule.test.d.mts +1 -0
- package/dist/tests/programmes/rules/MbaDegreeRule.test.mjs +55 -0
- package/dist/tests/programmes/rules/MbaOrMscDegreeRule.test.d.mts +1 -0
- package/dist/tests/programmes/rules/MbaOrMscDegreeRule.test.mjs +53 -0
- package/dist/tests/programmes/rules/MinimumAmountOfResultsRule.test.d.mts +1 -0
- package/dist/tests/programmes/rules/MinimumAmountOfResultsRule.test.mjs +79 -0
- package/dist/tests/programmes/rules/NotDistanceLearningPortalRule.test.d.mts +1 -0
- package/dist/tests/programmes/rules/NotDistanceLearningPortalRule.test.mjs +57 -0
- package/dist/tests/programmes/rules/OneYearDurationRule.test..d.mts +1 -0
- package/dist/tests/programmes/rules/OneYearDurationRule.test..mjs +40 -0
- package/dist/tests/programmes/rules/OnlineAttendanceRule.test.d.mts +1 -0
- package/dist/tests/programmes/rules/OnlineAttendanceRule.test.mjs +69 -0
- package/dist/tests/programmes/rules/PartTimeFormatRule.test.d.mts +1 -0
- package/dist/tests/programmes/rules/PartTimeFormatRule.test.mjs +27 -0
- package/dist/tests/programmes/utils/SearchDependencies.util.d.mts +16 -0
- package/dist/tests/programmes/utils/SearchDependencies.util.mjs +73 -0
- package/dist/tests/programmes/utils/SitemapDependencies.util.d.mts +15 -0
- package/dist/tests/programmes/utils/SitemapDependencies.util.mjs +49 -0
- package/dist/tests/scholarships/policies/Area.test.d.mts +1 -0
- package/dist/tests/scholarships/policies/Area.test.mjs +121 -0
- package/dist/tests/scholarships/policies/Country.test.d.mts +1 -0
- package/dist/tests/scholarships/policies/Country.test.mjs +97 -0
- package/dist/tests/scholarships/policies/Discipline.test.d.mts +1 -0
- package/dist/tests/scholarships/policies/Discipline.test.mjs +93 -0
- package/dist/tests/scholarships/policies/DisciplineCountry.test.d.mts +1 -0
- package/dist/tests/scholarships/policies/DisciplineCountry.test.mjs +151 -0
- package/dist/tests/scholarships/policies/Unfiltered.test.d.mts +1 -0
- package/dist/tests/scholarships/policies/Unfiltered.test.mjs +44 -0
- package/dist/tests/scholarships/policies/UniversityCountry.test.d.mts +1 -0
- package/dist/tests/scholarships/policies/UniversityCountry.test.mjs +115 -0
- package/dist/tests/scholarships/rules/ExceptAustaliaAreasRule.test.d.mts +1 -0
- package/dist/tests/scholarships/rules/ExceptAustaliaAreasRule.test.mjs +64 -0
- package/dist/tests/scholarships/rules/SearchVolumeAreasRule.test.d.mts +1 -0
- package/dist/tests/scholarships/rules/SearchVolumeAreasRule.test.mjs +62 -0
- package/dist/tests/scholarships/rules/SearchVolumeCountriesDisciplinesRule.test.d.mts +1 -0
- package/dist/tests/scholarships/rules/SearchVolumeCountriesDisciplinesRule.test.mjs +114 -0
- package/dist/tests/scholarships/rules/SearchVolumeCountriesRule.test.d.mts +1 -0
- package/dist/tests/scholarships/rules/SearchVolumeCountriesRule.test.mjs +62 -0
- package/dist/tests/scholarships/rules/SearchVolumeDisciplinesRule.test.d.mts +1 -0
- package/dist/tests/scholarships/rules/SearchVolumeDisciplinesRule.test.mjs +62 -0
- package/dist/tests/scholarships/utils/SearchDependencies.util.d.mts +16 -0
- package/dist/tests/scholarships/utils/SearchDependencies.util.mjs +70 -0
- package/dist/tests/scholarships/utils/SitemapDependencies.util.d.mts +11 -0
- package/dist/tests/scholarships/utils/SitemapDependencies.util.mjs +33 -0
- package/dist/tests/sitemap-generator/BaseSitemapUrlGeneratorManager.test.d.mts +1 -0
- package/dist/tests/sitemap-generator/BaseSitemapUrlGeneratorManager.test.mjs +82 -0
- package/dist/tests/sitemap-generator/OrganisationsSitemapUrlGeneratorManager.test.d.mts +1 -0
- package/dist/tests/sitemap-generator/OrganisationsSitemapUrlGeneratorManager.test.mjs +85 -0
- package/dist/tests/sitemap-generator/ProgrammesSitemapUrlGeneratorManager.test.d.mts +1 -0
- package/dist/tests/sitemap-generator/ProgrammesSitemapUrlGeneratorManager.test.mjs +77 -0
- package/dist/tests/sitemap-generator/ScholarshipsSitemapUrlGeneratorManager.test.d.mts +1 -0
- package/dist/tests/sitemap-generator/ScholarshipsSitemapUrlGeneratorManager.test.mjs +60 -0
- package/dist/tests/structured-data/OrganisationStructuredDataFactory.test.d.mts +1 -0
- package/dist/tests/structured-data/OrganisationStructuredDataFactory.test.mjs +334 -0
- package/dist/tests/structured-data/ProgrammeStructuredDataFactory.test.d.mts +1 -0
- package/dist/tests/structured-data/ProgrammeStructuredDataFactory.test.mjs +562 -0
- package/dist/tests/structured-data/ScholarshipStructuredDataFactory.test.d.mts +1 -0
- package/dist/tests/structured-data/ScholarshipStructuredDataFactory.test.mjs +292 -0
- package/dist/tests/structured-data/SearchStructuredDataFactory.paywall.test.d.mts +1 -0
- package/dist/tests/structured-data/SearchStructuredDataFactory.paywall.test.mjs +258 -0
- package/package.json +1 -1
- package/dist/src/programmes/policies/AttendanceTuitionFee.d.ts +0 -17
- package/dist/src/programmes/policies/AttendanceTuitionFee.js +0 -51
- package/dist/src/programmes/policies/ContinentTuitionFee.d.ts +0 -16
- package/dist/src/programmes/policies/ContinentTuitionFee.js +0 -46
- package/dist/src/programmes/policies/CountryTuitionFee.d.ts +0 -16
- package/dist/src/programmes/policies/CountryTuitionFee.js +0 -46
- package/dist/src/programmes/policies/DegreeAreaTuitionFee.d.ts +0 -16
- package/dist/src/programmes/policies/DisciplineTuitionFee.js +0 -46
- package/dist/src/programmes/policies/DisciplineTuitionFeeAttendance.d.ts +0 -17
- package/dist/src/programmes/policies/DisciplineTuitionFeeAttendance.js +0 -54
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { describe, it, expect, beforeEach, vi, afterEach } from 'vitest';
|
|
2
|
+
import { FilterKey } from '@studyportals/search-filters/server-side';
|
|
3
|
+
import { SearchDependencies } from '../utils/SearchDependencies.util.mjs';
|
|
4
|
+
import { SitemapDependencies } from '../utils/SitemapDependencies.util.mjs';
|
|
5
|
+
import { SpecialProgrammes } from '@/programmes/policies/SpecialProgrammes';
|
|
6
|
+
import { PortalType } from '@studyportals/domain-client';
|
|
7
|
+
import { SpecialProgrammesPresenter } from '@/presenters/SpecialProgrammesPresenter';
|
|
8
|
+
describe('Policy:SpecialProgrammes', () => {
|
|
9
|
+
describe('shouldIndex', () => {
|
|
10
|
+
let searchDependenciesHelper;
|
|
11
|
+
let specialProgrammesPolicy;
|
|
12
|
+
beforeEach(() => {
|
|
13
|
+
searchDependenciesHelper = new SearchDependencies();
|
|
14
|
+
specialProgrammesPolicy = new SpecialProgrammes(searchDependenciesHelper.dependencies);
|
|
15
|
+
searchDependenciesHelper.setResultsCount(10);
|
|
16
|
+
searchDependenciesHelper.setPageNumber(1);
|
|
17
|
+
searchDependenciesHelper.setPortalType(PortalType.SHORT);
|
|
18
|
+
});
|
|
19
|
+
it('Should return true when all conditions are met (Erasmus)', async () => {
|
|
20
|
+
const specialProgramme = 'erasmus';
|
|
21
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([[FilterKey.SPECIAL_PROGRAMMES, [specialProgramme]]]));
|
|
22
|
+
const result = await specialProgrammesPolicy.shouldIndex();
|
|
23
|
+
expect(result).toBe(true);
|
|
24
|
+
});
|
|
25
|
+
it('Should return true when all conditions are met (Joint)', async () => {
|
|
26
|
+
const specialProgramme = 'joint';
|
|
27
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([[FilterKey.SPECIAL_PROGRAMMES, [specialProgramme]]]));
|
|
28
|
+
const result = await specialProgrammesPolicy.shouldIndex();
|
|
29
|
+
expect(result).toBe(true);
|
|
30
|
+
});
|
|
31
|
+
it('Should return true when all conditions are met (Executive)', async () => {
|
|
32
|
+
const specialProgramme = 'executive';
|
|
33
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([[FilterKey.SPECIAL_PROGRAMMES, [specialProgramme]]]));
|
|
34
|
+
const result = await specialProgrammesPolicy.shouldIndex();
|
|
35
|
+
expect(result).toBe(true);
|
|
36
|
+
});
|
|
37
|
+
it('Should return false when multiple special programmes are selected', async () => {
|
|
38
|
+
const firstSpecialProgramme = 'erasmus';
|
|
39
|
+
const secondSpecialProgramme = 'joint';
|
|
40
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([[FilterKey.SPECIAL_PROGRAMMES, [firstSpecialProgramme, secondSpecialProgramme]]]));
|
|
41
|
+
const result = await specialProgrammesPolicy.shouldIndex();
|
|
42
|
+
expect(result).toBe(false);
|
|
43
|
+
});
|
|
44
|
+
it('Should return false when no special programmes are selected', async () => {
|
|
45
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([]));
|
|
46
|
+
const result = await specialProgrammesPolicy.shouldIndex();
|
|
47
|
+
expect(result).toBe(false);
|
|
48
|
+
});
|
|
49
|
+
it('Should return false when other filters are selected', async () => {
|
|
50
|
+
const specialProgramme = 'erasmus';
|
|
51
|
+
const disciplineId = '54'; // Agriculture & Forestry
|
|
52
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([
|
|
53
|
+
[FilterKey.SPECIAL_PROGRAMMES, [specialProgramme]],
|
|
54
|
+
[FilterKey.DISCIPLINES, [disciplineId]]
|
|
55
|
+
]));
|
|
56
|
+
const result = await specialProgrammesPolicy.shouldIndex();
|
|
57
|
+
expect(result).toBe(false);
|
|
58
|
+
});
|
|
59
|
+
it('Should return false when number of results is less than 7', async () => {
|
|
60
|
+
const specialProgramme = 'erasmus';
|
|
61
|
+
searchDependenciesHelper.setResultsCount(6);
|
|
62
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([[FilterKey.SPECIAL_PROGRAMMES, [specialProgramme]]]));
|
|
63
|
+
const result = await specialProgrammesPolicy.shouldIndex();
|
|
64
|
+
expect(result).toBe(false);
|
|
65
|
+
});
|
|
66
|
+
it('Should return false when page number is higher than 2', async () => {
|
|
67
|
+
const specialProgramme = 'erasmus';
|
|
68
|
+
searchDependenciesHelper.setPageNumber(15);
|
|
69
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([[FilterKey.SPECIAL_PROGRAMMES, [specialProgramme]]]));
|
|
70
|
+
const result = await specialProgrammesPolicy.shouldIndex();
|
|
71
|
+
expect(result).toBe(false);
|
|
72
|
+
});
|
|
73
|
+
it('Should return false when portal type is distance learning', async () => {
|
|
74
|
+
const specialProgramme = 'erasmus';
|
|
75
|
+
searchDependenciesHelper.setPortalType(PortalType.DISTANCE_LEARNING);
|
|
76
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([[FilterKey.SPECIAL_PROGRAMMES, [specialProgramme]]]));
|
|
77
|
+
const result = await specialProgrammesPolicy.shouldIndex();
|
|
78
|
+
expect(result).toBe(false);
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
describe('generateUrls', () => {
|
|
82
|
+
let sitemapDependenciesHelper;
|
|
83
|
+
let specialProgrammesPolicy;
|
|
84
|
+
beforeEach(() => {
|
|
85
|
+
sitemapDependenciesHelper = new SitemapDependencies();
|
|
86
|
+
sitemapDependenciesHelper.setProgrammeCount(10); // More than 7 programs
|
|
87
|
+
specialProgrammesPolicy = new SpecialProgrammes(sitemapDependenciesHelper.dependencies);
|
|
88
|
+
SpecialProgrammesPresenter.getInstance = vi.fn().mockReturnValue({
|
|
89
|
+
getFragments: vi.fn().mockReturnValue([
|
|
90
|
+
{ id: 'erasmus', path: 'erasmus-mundus' },
|
|
91
|
+
{ id: 'joint', path: 'joint-programmes' },
|
|
92
|
+
{ id: 'other', path: 'other-programme' }
|
|
93
|
+
])
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
afterEach(() => {
|
|
97
|
+
sitemapDependenciesHelper.resetMocks();
|
|
98
|
+
});
|
|
99
|
+
it('Should generate URLs for valid special programmes (Erasmus and Joint)', async () => {
|
|
100
|
+
// Mock the checkRulesForSitemap to only allow Erasmus and Joint programmes
|
|
101
|
+
// due to ErasmusOrJointSpecialProgrammesRule
|
|
102
|
+
const resultMap = new Map();
|
|
103
|
+
// Set up all possible combinations but only allow Erasmus and Joint
|
|
104
|
+
for (const programme of ['erasmus', 'joint', 'other']) {
|
|
105
|
+
const key = `${FilterKey.SPECIAL_PROGRAMMES}:${programme}`;
|
|
106
|
+
// Only Erasmus and Joint should pass
|
|
107
|
+
resultMap.set(key, programme === 'erasmus' || programme === 'joint');
|
|
108
|
+
}
|
|
109
|
+
sitemapDependenciesHelper.mockCheckRulesForSitemap(resultMap);
|
|
110
|
+
// Call the method via reflection since it's protected
|
|
111
|
+
const urls = await specialProgrammesPolicy.generateUrls();
|
|
112
|
+
// Calculate expected URLs: 2 special programmes (Erasmus and Joint) * 2 pages = 4
|
|
113
|
+
expect(urls).toHaveLength(2);
|
|
114
|
+
// Verify Erasmus and Joint are included
|
|
115
|
+
expect(urls).toContain('erasmus-mundus');
|
|
116
|
+
expect(urls).toContain('joint-programmes');
|
|
117
|
+
// Verify other programmes are excluded
|
|
118
|
+
expect(urls).not.toContain('other-programme');
|
|
119
|
+
});
|
|
120
|
+
it('Should exclude all special programmes when all rule checks fail', async () => {
|
|
121
|
+
// Create a map that returns false for all combinations
|
|
122
|
+
const resultMap = new Map();
|
|
123
|
+
for (const programme of ['erasmus', 'joint', 'other']) {
|
|
124
|
+
const key = `${FilterKey.SPECIAL_PROGRAMMES}:${programme}`;
|
|
125
|
+
resultMap.set(key, false);
|
|
126
|
+
}
|
|
127
|
+
sitemapDependenciesHelper.mockCheckRulesForSitemap(resultMap);
|
|
128
|
+
const urls = await specialProgrammesPolicy.generateUrls();
|
|
129
|
+
// Should include no URLs
|
|
130
|
+
expect(urls).toHaveLength(0);
|
|
131
|
+
});
|
|
132
|
+
it('Should handle empty special programmes fragments', async () => {
|
|
133
|
+
// Mock the SpecialProgrammesPresenter to return empty fragments
|
|
134
|
+
SpecialProgrammesPresenter.getInstance.mockReturnValueOnce({
|
|
135
|
+
getFragments: vi.fn().mockReturnValue([])
|
|
136
|
+
});
|
|
137
|
+
sitemapDependenciesHelper.mockCheckRulesForSitemap();
|
|
138
|
+
const urls = await specialProgrammesPolicy.generateUrls();
|
|
139
|
+
// Should return empty array
|
|
140
|
+
expect(urls).toHaveLength(0);
|
|
141
|
+
});
|
|
142
|
+
it('Should handle performance with large number of special programmes', async () => {
|
|
143
|
+
// Generate larger datasets for testing
|
|
144
|
+
const largeSpecialProgrammeSet = Array.from({ length: 30 }, (_, index) => ({
|
|
145
|
+
id: `programme-${index}`,
|
|
146
|
+
path: `programme-path-${index}`
|
|
147
|
+
}));
|
|
148
|
+
// Override mocks with large datasets
|
|
149
|
+
SpecialProgrammesPresenter.getInstance.mockReturnValueOnce({
|
|
150
|
+
getFragments: vi.fn().mockReturnValue(largeSpecialProgrammeSet)
|
|
151
|
+
});
|
|
152
|
+
// Mock to only allow combinations where the programme index is even
|
|
153
|
+
// This simulates the ErasmusOrJointSpecialProgrammesRule
|
|
154
|
+
const resultMap = new Map();
|
|
155
|
+
for (let p = 0; p < largeSpecialProgrammeSet.length; p++) {
|
|
156
|
+
const programmeId = largeSpecialProgrammeSet[p].id;
|
|
157
|
+
const key = `${FilterKey.SPECIAL_PROGRAMMES}:${programmeId}`;
|
|
158
|
+
resultMap.set(key, p % 2 === 0); // Only even indices pass
|
|
159
|
+
}
|
|
160
|
+
sitemapDependenciesHelper.mockCheckRulesForSitemap(resultMap);
|
|
161
|
+
const urls = await specialProgrammesPolicy.generateUrls();
|
|
162
|
+
// Calculate expected count: 15 special programmes (even indices) * 2 pages = 30
|
|
163
|
+
expect(urls).toHaveLength(15);
|
|
164
|
+
// Test specific items
|
|
165
|
+
expect(urls).toContain('programme-path-0'); // Even index
|
|
166
|
+
expect(urls).toContain('programme-path-2'); // Even index
|
|
167
|
+
expect(urls).not.toContain('programme-path-1'); // Odd index
|
|
168
|
+
expect(urls).not.toContain('programme-path-3'); // Odd index
|
|
169
|
+
});
|
|
170
|
+
});
|
|
171
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,360 @@
|
|
|
1
|
+
import { describe, it, expect, beforeEach, vi, afterEach } from 'vitest';
|
|
2
|
+
import { FilterKey } from '@studyportals/search-filters/server-side';
|
|
3
|
+
import { SearchDependencies } from '../utils/SearchDependencies.util.mjs';
|
|
4
|
+
import { SitemapDependencies } from '../utils/SitemapDependencies.util.mjs';
|
|
5
|
+
import { TuitionFeeAttendanceDiscipline } from '@/programmes/policies/TuitionFeeAttendanceDiscipline';
|
|
6
|
+
import { PortalType } from '@studyportals/domain-client';
|
|
7
|
+
import { DisciplinePresenter } from '@/presenters/DisciplinePresenter';
|
|
8
|
+
import { AttendancePresenter } from '@/presenters/AttendancePresenter';
|
|
9
|
+
import { TuitionFeePresenter } from '@/presenters/TuitionFeePresenter';
|
|
10
|
+
describe('Policy:TuitionFeeAttendanceDiscipline', () => {
|
|
11
|
+
describe('shouldIndex', () => {
|
|
12
|
+
let searchDependenciesHelper;
|
|
13
|
+
let tuitionFeeAttendanceDisciplinePolicy;
|
|
14
|
+
beforeEach(() => {
|
|
15
|
+
searchDependenciesHelper = new SearchDependencies();
|
|
16
|
+
tuitionFeeAttendanceDisciplinePolicy = new TuitionFeeAttendanceDiscipline(searchDependenciesHelper.dependencies);
|
|
17
|
+
searchDependenciesHelper.setResultsCount(7);
|
|
18
|
+
searchDependenciesHelper.setPageNumber(1);
|
|
19
|
+
searchDependenciesHelper.setPortalType(PortalType.PHD);
|
|
20
|
+
});
|
|
21
|
+
it('Should return true when all conditions are met', async () => {
|
|
22
|
+
const disciplineId = '54'; // Agriculture & Forestry
|
|
23
|
+
const tuitionFee = '[0,2500]'; // Affordable
|
|
24
|
+
const attendance = 'online';
|
|
25
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([
|
|
26
|
+
[FilterKey.DISCIPLINES, [disciplineId]],
|
|
27
|
+
[FilterKey.TUITION_FEE, [tuitionFee]],
|
|
28
|
+
[FilterKey.DELIVERY_METHOD, [attendance]]
|
|
29
|
+
]));
|
|
30
|
+
const result = await tuitionFeeAttendanceDisciplinePolicy.shouldIndex();
|
|
31
|
+
expect(result).toBe(true);
|
|
32
|
+
});
|
|
33
|
+
it('Should return false when multiple disciplines are selected', async () => {
|
|
34
|
+
const firstDisciplineId = '54'; // Agriculture & Forestry
|
|
35
|
+
const secondDisciplineId = '12'; // Applied Sciences & Professions
|
|
36
|
+
const tuitionFee = '[0,2500]'; // Affordable
|
|
37
|
+
const attendance = 'online';
|
|
38
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([
|
|
39
|
+
[FilterKey.DISCIPLINES, [firstDisciplineId, secondDisciplineId]],
|
|
40
|
+
[FilterKey.TUITION_FEE, [tuitionFee]],
|
|
41
|
+
[FilterKey.DELIVERY_METHOD, [attendance]]
|
|
42
|
+
]));
|
|
43
|
+
const result = await tuitionFeeAttendanceDisciplinePolicy.shouldIndex();
|
|
44
|
+
expect(result).toBe(false);
|
|
45
|
+
});
|
|
46
|
+
it('Should return false when multiple tuition fee values are selected', async () => {
|
|
47
|
+
const disciplineId = '54'; // Agriculture & Forestry
|
|
48
|
+
const firstTuitionFee = '[0,2500]'; // Affordable
|
|
49
|
+
const secondTuitionFee = '[0,3000]';
|
|
50
|
+
const attendance = 'online';
|
|
51
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([
|
|
52
|
+
[FilterKey.DISCIPLINES, [disciplineId]],
|
|
53
|
+
[FilterKey.TUITION_FEE, [firstTuitionFee, secondTuitionFee]],
|
|
54
|
+
[FilterKey.DELIVERY_METHOD, [attendance]]
|
|
55
|
+
]));
|
|
56
|
+
const result = await tuitionFeeAttendanceDisciplinePolicy.shouldIndex();
|
|
57
|
+
expect(result).toBe(false);
|
|
58
|
+
});
|
|
59
|
+
it('Should return false when multiple attendance values are selected', async () => {
|
|
60
|
+
const disciplineId = '54'; // Agriculture & Forestry
|
|
61
|
+
const tuitionFee = '[0,2500]'; // Affordable
|
|
62
|
+
const firstAttendance = 'online';
|
|
63
|
+
const secondAttendance = 'blended';
|
|
64
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([
|
|
65
|
+
[FilterKey.DISCIPLINES, [disciplineId]],
|
|
66
|
+
[FilterKey.TUITION_FEE, [tuitionFee]],
|
|
67
|
+
[FilterKey.DELIVERY_METHOD, [firstAttendance, secondAttendance]]
|
|
68
|
+
]));
|
|
69
|
+
const result = await tuitionFeeAttendanceDisciplinePolicy.shouldIndex();
|
|
70
|
+
expect(result).toBe(false);
|
|
71
|
+
});
|
|
72
|
+
it('Should return false when no disciplines are selected', async () => {
|
|
73
|
+
const tuitionFee = '[0,2500]'; // Affordable
|
|
74
|
+
const attendance = 'online';
|
|
75
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([
|
|
76
|
+
[FilterKey.TUITION_FEE, [tuitionFee]],
|
|
77
|
+
[FilterKey.DELIVERY_METHOD, [attendance]]
|
|
78
|
+
]));
|
|
79
|
+
const result = await tuitionFeeAttendanceDisciplinePolicy.shouldIndex();
|
|
80
|
+
expect(result).toBe(false);
|
|
81
|
+
});
|
|
82
|
+
it('Should return false when no tuition fee value is selected', async () => {
|
|
83
|
+
const disciplineId = '54'; // Agriculture & Forestry
|
|
84
|
+
const attendance = 'online';
|
|
85
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([
|
|
86
|
+
[FilterKey.DISCIPLINES, [disciplineId]],
|
|
87
|
+
[FilterKey.DELIVERY_METHOD, [attendance]]
|
|
88
|
+
]));
|
|
89
|
+
const result = await tuitionFeeAttendanceDisciplinePolicy.shouldIndex();
|
|
90
|
+
expect(result).toBe(false);
|
|
91
|
+
});
|
|
92
|
+
it('Should return false when no attendance value is selected', async () => {
|
|
93
|
+
const disciplineId = '54'; // Agriculture & Forestry
|
|
94
|
+
const tuitionFee = '[0,2500]'; // Affordable
|
|
95
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([
|
|
96
|
+
[FilterKey.DISCIPLINES, [disciplineId]],
|
|
97
|
+
[FilterKey.TUITION_FEE, [tuitionFee]]
|
|
98
|
+
]));
|
|
99
|
+
const result = await tuitionFeeAttendanceDisciplinePolicy.shouldIndex();
|
|
100
|
+
expect(result).toBe(false);
|
|
101
|
+
});
|
|
102
|
+
it('Should return false when other filters are selected', async () => {
|
|
103
|
+
const disciplineId = '54'; // Agriculture & Forestry
|
|
104
|
+
const tuitionFee = '[0,2500]'; // Affordable
|
|
105
|
+
const attendance = 'online';
|
|
106
|
+
const countryId = '30'; // UK
|
|
107
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([
|
|
108
|
+
[FilterKey.DISCIPLINES, [disciplineId]],
|
|
109
|
+
[FilterKey.TUITION_FEE, [tuitionFee]],
|
|
110
|
+
[FilterKey.DELIVERY_METHOD, [attendance]],
|
|
111
|
+
[FilterKey.COUNTRY, [countryId]]
|
|
112
|
+
]));
|
|
113
|
+
const result = await tuitionFeeAttendanceDisciplinePolicy.shouldIndex();
|
|
114
|
+
expect(result).toBe(false);
|
|
115
|
+
});
|
|
116
|
+
it('Should return false when tuition fee is not [0,2500] (affordable)', async () => {
|
|
117
|
+
const disciplineId = '54'; // Agriculture & Forestry
|
|
118
|
+
const tuitionFee = '[0,3000]';
|
|
119
|
+
const attendance = 'online';
|
|
120
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([
|
|
121
|
+
[FilterKey.DISCIPLINES, [disciplineId]],
|
|
122
|
+
[FilterKey.TUITION_FEE, [tuitionFee]],
|
|
123
|
+
[FilterKey.DELIVERY_METHOD, [attendance]]
|
|
124
|
+
]));
|
|
125
|
+
const result = await tuitionFeeAttendanceDisciplinePolicy.shouldIndex();
|
|
126
|
+
expect(result).toBe(false);
|
|
127
|
+
});
|
|
128
|
+
it('Should return false when attendance is not online', async () => {
|
|
129
|
+
const disciplineId = '54'; // Agriculture & Forestry
|
|
130
|
+
const tuitionFee = '[0,2500]';
|
|
131
|
+
const attendance = 'face2face';
|
|
132
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([
|
|
133
|
+
[FilterKey.DISCIPLINES, [disciplineId]],
|
|
134
|
+
[FilterKey.TUITION_FEE, [tuitionFee]],
|
|
135
|
+
[FilterKey.DELIVERY_METHOD, [attendance]]
|
|
136
|
+
]));
|
|
137
|
+
const result = await tuitionFeeAttendanceDisciplinePolicy.shouldIndex();
|
|
138
|
+
expect(result).toBe(false);
|
|
139
|
+
});
|
|
140
|
+
it('Should return false when number of results is less than 7', async () => {
|
|
141
|
+
const disciplineId = '54'; // Agriculture & Forestry
|
|
142
|
+
const tuitionFee = '[0,2500]'; // Affordable
|
|
143
|
+
const attendance = 'online';
|
|
144
|
+
searchDependenciesHelper.setResultsCount(5);
|
|
145
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([
|
|
146
|
+
[FilterKey.DISCIPLINES, [disciplineId]],
|
|
147
|
+
[FilterKey.TUITION_FEE, [tuitionFee]],
|
|
148
|
+
[FilterKey.DELIVERY_METHOD, [attendance]]
|
|
149
|
+
]));
|
|
150
|
+
const result = await tuitionFeeAttendanceDisciplinePolicy.shouldIndex();
|
|
151
|
+
expect(result).toBe(false);
|
|
152
|
+
});
|
|
153
|
+
it('Should return false when page number is higher than 2', async () => {
|
|
154
|
+
const disciplineId = '54'; // Agriculture & Forestry
|
|
155
|
+
const tuitionFee = '[0,2500]'; // Affordable
|
|
156
|
+
const attendance = 'online';
|
|
157
|
+
searchDependenciesHelper.setPageNumber(4);
|
|
158
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([
|
|
159
|
+
[FilterKey.DISCIPLINES, [disciplineId]],
|
|
160
|
+
[FilterKey.TUITION_FEE, [tuitionFee]],
|
|
161
|
+
[FilterKey.DELIVERY_METHOD, [attendance]]
|
|
162
|
+
]));
|
|
163
|
+
const result = await tuitionFeeAttendanceDisciplinePolicy.shouldIndex();
|
|
164
|
+
expect(result).toBe(false);
|
|
165
|
+
});
|
|
166
|
+
it('Should return false when portal is distance learning', async () => {
|
|
167
|
+
const disciplineId = '54'; // Agriculture & Forestry
|
|
168
|
+
const tuitionFee = '[0,2500]'; // Affordable
|
|
169
|
+
const attendance = 'online';
|
|
170
|
+
searchDependenciesHelper.setPortalType(PortalType.DISTANCE_LEARNING);
|
|
171
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([
|
|
172
|
+
[FilterKey.DISCIPLINES, [disciplineId]],
|
|
173
|
+
[FilterKey.TUITION_FEE, [tuitionFee]],
|
|
174
|
+
[FilterKey.DELIVERY_METHOD, [attendance]]
|
|
175
|
+
]));
|
|
176
|
+
const result = await tuitionFeeAttendanceDisciplinePolicy.shouldIndex();
|
|
177
|
+
expect(result).toBe(false);
|
|
178
|
+
});
|
|
179
|
+
});
|
|
180
|
+
describe('generateUrls', () => {
|
|
181
|
+
let sitemapDependenciesHelper;
|
|
182
|
+
let tuitionFeeAttendanceDisciplinePolicy;
|
|
183
|
+
beforeEach(() => {
|
|
184
|
+
sitemapDependenciesHelper = new SitemapDependencies();
|
|
185
|
+
sitemapDependenciesHelper.setProgrammeCount(10); // More than 7 programs
|
|
186
|
+
tuitionFeeAttendanceDisciplinePolicy = new TuitionFeeAttendanceDiscipline(sitemapDependenciesHelper.dependencies);
|
|
187
|
+
DisciplinePresenter.getInstance = vi.fn().mockReturnValue({
|
|
188
|
+
getFragments: vi.fn().mockReturnValue([
|
|
189
|
+
{ id: '54', path: 'agriculture-forestry' },
|
|
190
|
+
{ id: '12', path: 'applied-sciences' },
|
|
191
|
+
{ id: '356', path: 'computer-science' }
|
|
192
|
+
])
|
|
193
|
+
});
|
|
194
|
+
TuitionFeePresenter.getInstance = vi.fn().mockReturnValue({
|
|
195
|
+
getFragments: vi.fn().mockReturnValue([
|
|
196
|
+
{ id: '[0,2500]', path: 'affordable' },
|
|
197
|
+
{ id: '[2501,5000]', path: 'moderate' },
|
|
198
|
+
{ id: '[5001,10000]', path: 'expensive' }
|
|
199
|
+
])
|
|
200
|
+
});
|
|
201
|
+
AttendancePresenter.getInstance = vi.fn().mockReturnValue({
|
|
202
|
+
getFragments: vi.fn().mockReturnValue([
|
|
203
|
+
{ id: 'online', path: 'online' },
|
|
204
|
+
{ id: 'face2face', path: 'on-campus' },
|
|
205
|
+
{ id: 'blended', path: 'blended' }
|
|
206
|
+
])
|
|
207
|
+
});
|
|
208
|
+
});
|
|
209
|
+
afterEach(() => {
|
|
210
|
+
sitemapDependenciesHelper.resetMocks();
|
|
211
|
+
});
|
|
212
|
+
it('Should generate URLs for valid discipline-tuition fee-attendance combinations with affordable tuition fees and online attendance', async () => {
|
|
213
|
+
// Mock the checkRulesForSitemap to only allow affordable tuition fee options and online attendance
|
|
214
|
+
// due to AffordableTuitionFeeRule and OnlineAttendanceRule
|
|
215
|
+
const resultMap = new Map();
|
|
216
|
+
// Set up all possible combinations but only allow affordable tuition fee and online attendance
|
|
217
|
+
for (const discipline of ['54', '12', '356']) {
|
|
218
|
+
for (const attendance of ['online', 'face2face', 'blended']) {
|
|
219
|
+
for (const tuitionFee of ['[0,2500]', '[2501,5000]', '[5001,10000]']) {
|
|
220
|
+
const key = `${FilterKey.TUITION_FEE}:${tuitionFee}|${FilterKey.DELIVERY_METHOD}:${attendance}|${FilterKey.DISCIPLINES}:${discipline}`;
|
|
221
|
+
// Only affordable tuition fee and online attendance should pass
|
|
222
|
+
resultMap.set(key, tuitionFee === '[0,2500]' && attendance === 'online');
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
sitemapDependenciesHelper.mockCheckRulesForSitemap(resultMap);
|
|
227
|
+
// Call the method via reflection since it's protected
|
|
228
|
+
const urls = await tuitionFeeAttendanceDisciplinePolicy.generateUrls();
|
|
229
|
+
// Calculate expected URLs: 3 disciplines * 1 tuition fee option (affordable) * 1 attendance (online) * 2 pages
|
|
230
|
+
expect(urls).toHaveLength(3);
|
|
231
|
+
// Verify affordable tuition fee and online attendance combinations
|
|
232
|
+
expect(urls).toContain('affordable/online/agriculture-forestry');
|
|
233
|
+
expect(urls).toContain('affordable/online/applied-sciences');
|
|
234
|
+
expect(urls).toContain('affordable/online/computer-science');
|
|
235
|
+
// Verify non-online attendance or non-affordable tuition fees are excluded
|
|
236
|
+
expect(urls).not.toContain('affordable/on-campus/agriculture-forestry');
|
|
237
|
+
expect(urls).not.toContain('moderate/online/agriculture-forestry');
|
|
238
|
+
});
|
|
239
|
+
it('Should exclude specific discipline-tuition fee-attendance combinations based on rules', async () => {
|
|
240
|
+
// Create a map that returns false for specific combinations
|
|
241
|
+
const resultMap = new Map();
|
|
242
|
+
// Only allow affordable tuition fee and online attendance, but exclude computer science
|
|
243
|
+
for (const discipline of ['54', '12', '356']) {
|
|
244
|
+
for (const attendance of ['online', 'face2face', 'blended']) {
|
|
245
|
+
for (const tuitionFee of ['[0,2500]', '[2501,5000]', '[5001,10000]']) {
|
|
246
|
+
const key = `${FilterKey.TUITION_FEE}:${tuitionFee}|${FilterKey.DELIVERY_METHOD}:${attendance}|${FilterKey.DISCIPLINES}:${discipline}`;
|
|
247
|
+
// Only affordable tuition fee and online attendance should pass and exclude computer science
|
|
248
|
+
resultMap.set(key, tuitionFee === '[0,2500]' && attendance === 'online' && discipline !== '356');
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
sitemapDependenciesHelper.mockCheckRulesForSitemap(resultMap);
|
|
253
|
+
const urls = await tuitionFeeAttendanceDisciplinePolicy.generateUrls();
|
|
254
|
+
// Calculate expected URLs: 2 disciplines (excluding computer science) * 1 tuition fee * 1 attendance * 2 pages
|
|
255
|
+
// = 2 * 1 * 1 * 2 = 4 URLs
|
|
256
|
+
expect(urls).toHaveLength(2);
|
|
257
|
+
// Verify excluded combinations
|
|
258
|
+
expect(urls).not.toContain('affordable/online/computer-science');
|
|
259
|
+
// Verify included combinations
|
|
260
|
+
expect(urls).toContain('affordable/online/agriculture-forestry');
|
|
261
|
+
expect(urls).toContain('affordable/online/applied-sciences');
|
|
262
|
+
});
|
|
263
|
+
it('Should exclude all URLs when all rule checks fail', async () => {
|
|
264
|
+
// Create a map that returns false for all combinations
|
|
265
|
+
const resultMap = new Map();
|
|
266
|
+
for (const discipline of ['54', '12', '356']) {
|
|
267
|
+
for (const attendance of ['online', 'face2face', 'blended']) {
|
|
268
|
+
for (const tuitionFee of ['[0,2500]', '[2501,5000]', '[5001,10000]']) {
|
|
269
|
+
const key = `${FilterKey.TUITION_FEE}:${tuitionFee}|${FilterKey.DELIVERY_METHOD}:${attendance}|${FilterKey.DISCIPLINES}:${discipline}`;
|
|
270
|
+
resultMap.set(key, false);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
sitemapDependenciesHelper.mockCheckRulesForSitemap(resultMap);
|
|
275
|
+
const urls = await tuitionFeeAttendanceDisciplinePolicy.generateUrls();
|
|
276
|
+
// Should include no URLs
|
|
277
|
+
expect(urls).toHaveLength(0);
|
|
278
|
+
});
|
|
279
|
+
it('Should handle empty discipline fragments', async () => {
|
|
280
|
+
// Mock the DisciplinePresenter to return empty fragments
|
|
281
|
+
DisciplinePresenter.getInstance.mockReturnValueOnce({
|
|
282
|
+
getFragments: vi.fn().mockReturnValue([])
|
|
283
|
+
});
|
|
284
|
+
sitemapDependenciesHelper.mockCheckRulesForSitemap();
|
|
285
|
+
const urls = await tuitionFeeAttendanceDisciplinePolicy.generateUrls();
|
|
286
|
+
// Should return empty array
|
|
287
|
+
expect(urls).toHaveLength(0);
|
|
288
|
+
});
|
|
289
|
+
it('Should handle empty attendance fragments', async () => {
|
|
290
|
+
// Mock the AttendancePresenter to return empty fragments
|
|
291
|
+
AttendancePresenter.getInstance.mockReturnValueOnce({
|
|
292
|
+
getFragments: vi.fn().mockReturnValue([])
|
|
293
|
+
});
|
|
294
|
+
sitemapDependenciesHelper.mockCheckRulesForSitemap();
|
|
295
|
+
const urls = await tuitionFeeAttendanceDisciplinePolicy.generateUrls();
|
|
296
|
+
// Should return empty array
|
|
297
|
+
expect(urls).toHaveLength(0);
|
|
298
|
+
});
|
|
299
|
+
it('Should handle empty tuition fee fragments', async () => {
|
|
300
|
+
// Mock the TuitionFeePresenter to return empty fragments
|
|
301
|
+
TuitionFeePresenter.getInstance.mockReturnValueOnce({
|
|
302
|
+
getFragments: vi.fn().mockReturnValue([])
|
|
303
|
+
});
|
|
304
|
+
sitemapDependenciesHelper.mockCheckRulesForSitemap();
|
|
305
|
+
const urls = await tuitionFeeAttendanceDisciplinePolicy.generateUrls();
|
|
306
|
+
// Should return empty array
|
|
307
|
+
expect(urls).toHaveLength(0);
|
|
308
|
+
});
|
|
309
|
+
it('Should handle performance with large number of combinations', async () => {
|
|
310
|
+
// Generate larger datasets for testing
|
|
311
|
+
const largeDisciplineSet = Array.from({ length: 10 }, (_, index) => ({
|
|
312
|
+
id: `discipline-${index}`,
|
|
313
|
+
path: `discipline-path-${index}`
|
|
314
|
+
}));
|
|
315
|
+
const largeAttendanceSet = Array.from({ length: 3 }, (_, index) => ({
|
|
316
|
+
id: `attendance-${index}`,
|
|
317
|
+
path: `attendance-path-${index}`
|
|
318
|
+
}));
|
|
319
|
+
const largeTuitionFeeSet = Array.from({ length: 3 }, (_, index) => ({
|
|
320
|
+
id: `tuition-${index}`,
|
|
321
|
+
path: `tuition-path-${index}`
|
|
322
|
+
}));
|
|
323
|
+
// Override mocks with large datasets
|
|
324
|
+
DisciplinePresenter.getInstance.mockReturnValueOnce({
|
|
325
|
+
getFragments: vi.fn().mockReturnValue(largeDisciplineSet)
|
|
326
|
+
});
|
|
327
|
+
AttendancePresenter.getInstance.mockReturnValueOnce({
|
|
328
|
+
getFragments: vi.fn().mockReturnValue(largeAttendanceSet)
|
|
329
|
+
});
|
|
330
|
+
TuitionFeePresenter.getInstance.mockReturnValueOnce({
|
|
331
|
+
getFragments: vi.fn().mockReturnValue(largeTuitionFeeSet)
|
|
332
|
+
});
|
|
333
|
+
// Mock to only allow combinations where discipline index is even, attendance index is 0 (online),
|
|
334
|
+
// and tuition fee index is 0 (affordable)
|
|
335
|
+
const resultMap = new Map();
|
|
336
|
+
for (let d = 0; d < largeDisciplineSet.length; d++) {
|
|
337
|
+
for (let a = 0; a < largeAttendanceSet.length; a++) {
|
|
338
|
+
for (let t = 0; t < largeTuitionFeeSet.length; t++) {
|
|
339
|
+
const disciplineId = largeDisciplineSet[d].id;
|
|
340
|
+
const attendanceId = largeAttendanceSet[a].id;
|
|
341
|
+
const tuitionFeeId = largeTuitionFeeSet[t].id;
|
|
342
|
+
const key = `${FilterKey.TUITION_FEE}:${tuitionFeeId}|${FilterKey.DELIVERY_METHOD}:${attendanceId}|${FilterKey.DISCIPLINES}:${disciplineId}`;
|
|
343
|
+
resultMap.set(key, d % 2 === 0 && a === 0 && t === 0); // Even disciplines, online attendance, affordable tuition
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
sitemapDependenciesHelper.mockCheckRulesForSitemap(resultMap);
|
|
348
|
+
const urls = await tuitionFeeAttendanceDisciplinePolicy.generateUrls();
|
|
349
|
+
// Calculate expected count: 5 disciplines (even indices) * 1 attendance (index 0) * 1 tuition fee (index 0) * 2 pages
|
|
350
|
+
// = 5 * 1 * 1 * 2 = 10 URLs
|
|
351
|
+
expect(urls).toHaveLength(5);
|
|
352
|
+
// Test specific items
|
|
353
|
+
expect(urls).toContain('tuition-path-0/attendance-path-0/discipline-path-0'); // Even discipline, online, affordable
|
|
354
|
+
expect(urls).toContain('tuition-path-0/attendance-path-0/discipline-path-2'); // Even discipline, online, affordable
|
|
355
|
+
expect(urls).not.toContain('tuition-path-0/attendance-path-0/discipline-path-1'); // Odd discipline
|
|
356
|
+
expect(urls).not.toContain('tuition-path-0/attendance-path-1/discipline-path-0'); // Non-online attendance
|
|
357
|
+
expect(urls).not.toContain('tuition-path-1/attendance-path-0/discipline-path-0'); // Non-affordable tuition
|
|
358
|
+
});
|
|
359
|
+
});
|
|
360
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|