@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,337 @@
|
|
|
1
|
+
import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest';
|
|
2
|
+
import { FilterKey } from '@studyportals/search-filters/server-side';
|
|
3
|
+
import { SearchDependencies } from '../utils/SearchDependencies.util.mjs';
|
|
4
|
+
import { CountryAttendanceDegree } from '@/programmes/policies/CountryAttendanceDegree';
|
|
5
|
+
import { PortalType } from '@studyportals/domain-client';
|
|
6
|
+
import { SitemapDependencies } from '../utils/SitemapDependencies.util.mjs';
|
|
7
|
+
import { CountryPresenter } from '@/presenters/CountryPresenter';
|
|
8
|
+
import { DegreePresenter } from '@/presenters/DegreePresenter';
|
|
9
|
+
import { AttendancePresenter } from '@/presenters/AttendancePresenter';
|
|
10
|
+
describe('Policy:CountryAttendanceDegree', () => {
|
|
11
|
+
describe('shouldIndex', () => {
|
|
12
|
+
let searchDependenciesHelper;
|
|
13
|
+
let countryAttendanceDegreePolicy;
|
|
14
|
+
beforeEach(() => {
|
|
15
|
+
searchDependenciesHelper = new SearchDependencies();
|
|
16
|
+
countryAttendanceDegreePolicy = new CountryAttendanceDegree(searchDependenciesHelper.dependencies);
|
|
17
|
+
searchDependenciesHelper.setResultsCount(10);
|
|
18
|
+
searchDependenciesHelper.setPageNumber(1);
|
|
19
|
+
searchDependenciesHelper.setPortalType(PortalType.SHORT);
|
|
20
|
+
});
|
|
21
|
+
it('Should return true when all conditions are met', async () => {
|
|
22
|
+
const countryId = '30'; // UK
|
|
23
|
+
const attendance = 'online';
|
|
24
|
+
const degree = 'mba';
|
|
25
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([
|
|
26
|
+
[FilterKey.COUNTRY, [countryId]],
|
|
27
|
+
[FilterKey.DELIVERY_METHOD, [attendance]],
|
|
28
|
+
[FilterKey.DEGREE_TYPE, [degree]]
|
|
29
|
+
]));
|
|
30
|
+
const result = await countryAttendanceDegreePolicy.shouldIndex();
|
|
31
|
+
expect(result).toBe(true);
|
|
32
|
+
});
|
|
33
|
+
it('Should return false when multiple attendance values are selected', async () => {
|
|
34
|
+
const firstAttendance = 'online';
|
|
35
|
+
const secondAttendance = 'blended';
|
|
36
|
+
const countryId = '30'; // UK
|
|
37
|
+
const degree = 'mba';
|
|
38
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([
|
|
39
|
+
[FilterKey.DELIVERY_METHOD, [firstAttendance, secondAttendance]],
|
|
40
|
+
[FilterKey.COUNTRY, [countryId]],
|
|
41
|
+
[FilterKey.DEGREE_TYPE, [degree]]
|
|
42
|
+
]));
|
|
43
|
+
const result = await countryAttendanceDegreePolicy.shouldIndex();
|
|
44
|
+
expect(result).toBe(false);
|
|
45
|
+
});
|
|
46
|
+
it('Should return false when multiple countries are selected', async () => {
|
|
47
|
+
const firstCountryId = '30'; // UK
|
|
48
|
+
const secondCountryId = '21'; // Portugal
|
|
49
|
+
const attendance = 'online';
|
|
50
|
+
const degree = 'mba';
|
|
51
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([
|
|
52
|
+
[FilterKey.COUNTRY, [firstCountryId, secondCountryId]],
|
|
53
|
+
[FilterKey.DEGREE_TYPE, [degree]],
|
|
54
|
+
[FilterKey.DELIVERY_METHOD, [attendance]]
|
|
55
|
+
]));
|
|
56
|
+
const result = await countryAttendanceDegreePolicy.shouldIndex();
|
|
57
|
+
expect(result).toBe(false);
|
|
58
|
+
});
|
|
59
|
+
it('Should return false when multiple degree values are selected', async () => {
|
|
60
|
+
const countryId = '30'; // UK
|
|
61
|
+
const attendance = 'online';
|
|
62
|
+
const firstDegree = 'mba';
|
|
63
|
+
const secondDegree = 'phd';
|
|
64
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([
|
|
65
|
+
[FilterKey.COUNTRY, [countryId]],
|
|
66
|
+
[FilterKey.DEGREE_TYPE, [firstDegree, secondDegree]],
|
|
67
|
+
[FilterKey.DELIVERY_METHOD, [attendance]]
|
|
68
|
+
]));
|
|
69
|
+
const result = await countryAttendanceDegreePolicy.shouldIndex();
|
|
70
|
+
expect(result).toBe(false);
|
|
71
|
+
});
|
|
72
|
+
it('Should return false when no attendance values are selected', async () => {
|
|
73
|
+
const degree = 'mba';
|
|
74
|
+
const countryId = '30'; // UK
|
|
75
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([
|
|
76
|
+
[FilterKey.DEGREE_TYPE, [degree]],
|
|
77
|
+
[FilterKey.COUNTRY, [countryId]]
|
|
78
|
+
]));
|
|
79
|
+
const result = await countryAttendanceDegreePolicy.shouldIndex();
|
|
80
|
+
expect(result).toBe(false);
|
|
81
|
+
});
|
|
82
|
+
it('Should return false when no countries are selected', async () => {
|
|
83
|
+
const attendance = 'online';
|
|
84
|
+
const degree = 'mba';
|
|
85
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([
|
|
86
|
+
[FilterKey.DELIVERY_METHOD, [attendance]],
|
|
87
|
+
[FilterKey.DEGREE_TYPE, [degree]]
|
|
88
|
+
]));
|
|
89
|
+
const result = await countryAttendanceDegreePolicy.shouldIndex();
|
|
90
|
+
expect(result).toBe(false);
|
|
91
|
+
});
|
|
92
|
+
it('Should return false when no degree values are selected', async () => {
|
|
93
|
+
const attendance = 'online';
|
|
94
|
+
const countryId = '30'; // UK
|
|
95
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([
|
|
96
|
+
[FilterKey.DELIVERY_METHOD, [attendance]],
|
|
97
|
+
[FilterKey.COUNTRY, [countryId]]
|
|
98
|
+
]));
|
|
99
|
+
const result = await countryAttendanceDegreePolicy.shouldIndex();
|
|
100
|
+
expect(result).toBe(false);
|
|
101
|
+
});
|
|
102
|
+
it('Should return false when other filters are selected', async () => {
|
|
103
|
+
const countryId = '30'; // UK
|
|
104
|
+
const attendance = 'online';
|
|
105
|
+
const degree = 'mba';
|
|
106
|
+
const disciplineId = '12'; // Applied Sciences & Professions
|
|
107
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([
|
|
108
|
+
[FilterKey.DELIVERY_METHOD, [attendance]],
|
|
109
|
+
[FilterKey.DEGREE_TYPE, [degree]],
|
|
110
|
+
[FilterKey.COUNTRY, [countryId]],
|
|
111
|
+
[FilterKey.DISCIPLINES, [disciplineId]]
|
|
112
|
+
]));
|
|
113
|
+
const result = await countryAttendanceDegreePolicy.shouldIndex();
|
|
114
|
+
expect(result).toBe(false);
|
|
115
|
+
});
|
|
116
|
+
it('Should return false when attendance is not online', async () => {
|
|
117
|
+
const countryId = '30'; // UK
|
|
118
|
+
const attendance = 'blended';
|
|
119
|
+
const degree = 'mba';
|
|
120
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([
|
|
121
|
+
[FilterKey.COUNTRY, [countryId]],
|
|
122
|
+
[FilterKey.DELIVERY_METHOD, [attendance]],
|
|
123
|
+
[FilterKey.DEGREE_TYPE, [degree]]
|
|
124
|
+
]));
|
|
125
|
+
const result = await countryAttendanceDegreePolicy.shouldIndex();
|
|
126
|
+
expect(result).toBe(false);
|
|
127
|
+
});
|
|
128
|
+
it('Should return false when degree is not MBA', async () => {
|
|
129
|
+
const countryId = '30'; // UK
|
|
130
|
+
const attendance = 'online';
|
|
131
|
+
const degree = 'phd';
|
|
132
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([
|
|
133
|
+
[FilterKey.COUNTRY, [countryId]],
|
|
134
|
+
[FilterKey.DELIVERY_METHOD, [attendance]],
|
|
135
|
+
[FilterKey.DEGREE_TYPE, [degree]]
|
|
136
|
+
]));
|
|
137
|
+
const result = await countryAttendanceDegreePolicy.shouldIndex();
|
|
138
|
+
expect(result).toBe(false);
|
|
139
|
+
});
|
|
140
|
+
it('Should return false when number of results is less than 7', async () => {
|
|
141
|
+
const countryId = '30'; // UK
|
|
142
|
+
const attendance = 'online';
|
|
143
|
+
const degree = 'phd';
|
|
144
|
+
searchDependenciesHelper.setResultsCount(6);
|
|
145
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([
|
|
146
|
+
[FilterKey.COUNTRY, [countryId]],
|
|
147
|
+
[FilterKey.DELIVERY_METHOD, [attendance]],
|
|
148
|
+
[FilterKey.DEGREE_TYPE, [degree]]
|
|
149
|
+
]));
|
|
150
|
+
const result = await countryAttendanceDegreePolicy.shouldIndex();
|
|
151
|
+
expect(result).toBe(false);
|
|
152
|
+
});
|
|
153
|
+
it('Should return false when page number is higher than 2', async () => {
|
|
154
|
+
const countryId = '30'; // UK
|
|
155
|
+
const attendance = 'online';
|
|
156
|
+
const degree = 'mba';
|
|
157
|
+
searchDependenciesHelper.setPageNumber(10);
|
|
158
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([
|
|
159
|
+
[FilterKey.COUNTRY, [countryId]],
|
|
160
|
+
[FilterKey.DELIVERY_METHOD, [attendance]],
|
|
161
|
+
[FilterKey.DEGREE_TYPE, [degree]]
|
|
162
|
+
]));
|
|
163
|
+
const result = await countryAttendanceDegreePolicy.shouldIndex();
|
|
164
|
+
expect(result).toBe(false);
|
|
165
|
+
});
|
|
166
|
+
it('Should return false when portal is distance learning', async () => {
|
|
167
|
+
const countryId = '30'; // UK
|
|
168
|
+
const attendance = 'online';
|
|
169
|
+
const degree = 'mba';
|
|
170
|
+
searchDependenciesHelper.setPortalType(PortalType.DISTANCE_LEARNING);
|
|
171
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([
|
|
172
|
+
[FilterKey.COUNTRY, [countryId]],
|
|
173
|
+
[FilterKey.DELIVERY_METHOD, [attendance]],
|
|
174
|
+
[FilterKey.DEGREE_TYPE, [degree]]
|
|
175
|
+
]));
|
|
176
|
+
const result = await countryAttendanceDegreePolicy.shouldIndex();
|
|
177
|
+
expect(result).toBe(false);
|
|
178
|
+
});
|
|
179
|
+
});
|
|
180
|
+
describe('generateUrls', () => {
|
|
181
|
+
let sitemapDependenciesHelper;
|
|
182
|
+
let countryAttendanceDegreePolicy;
|
|
183
|
+
beforeEach(() => {
|
|
184
|
+
sitemapDependenciesHelper = new SitemapDependencies();
|
|
185
|
+
sitemapDependenciesHelper.setProgrammeCount(10); // More than 7 programs
|
|
186
|
+
countryAttendanceDegreePolicy = new CountryAttendanceDegree(sitemapDependenciesHelper.dependencies);
|
|
187
|
+
CountryPresenter.getInstance = vi.fn().mockReturnValue({
|
|
188
|
+
getFragments: vi.fn().mockReturnValue([
|
|
189
|
+
{ id: '30', path: 'uk' },
|
|
190
|
+
{ id: '21', path: 'portugal' },
|
|
191
|
+
{ id: '56', path: 'usa' },
|
|
192
|
+
{ id: '82', path: 'netherlands' }
|
|
193
|
+
])
|
|
194
|
+
});
|
|
195
|
+
AttendancePresenter.getInstance = vi.fn().mockReturnValue({
|
|
196
|
+
getFragments: vi.fn().mockReturnValue([
|
|
197
|
+
{ id: 'online', path: 'online-programmes' },
|
|
198
|
+
{ id: 'face2face', path: 'on-campus-programmes' },
|
|
199
|
+
{ id: 'blended', path: 'blended-programmes' }
|
|
200
|
+
])
|
|
201
|
+
});
|
|
202
|
+
DegreePresenter.getInstance = vi.fn().mockReturnValue({
|
|
203
|
+
getFragments: vi.fn().mockReturnValue([
|
|
204
|
+
{ id: 'mba', path: 'mba' },
|
|
205
|
+
{ id: 'phd', path: 'phd' },
|
|
206
|
+
{ id: 'masters', path: 'masters' }
|
|
207
|
+
])
|
|
208
|
+
});
|
|
209
|
+
});
|
|
210
|
+
afterEach(() => {
|
|
211
|
+
sitemapDependenciesHelper.resetMocks();
|
|
212
|
+
});
|
|
213
|
+
it('Should generate URLs for all valid country-attendance-degree combinations', async () => {
|
|
214
|
+
// Mock the checkRulesForSitemap to only allow online attendance and MBA degree
|
|
215
|
+
const resultMap = new Map();
|
|
216
|
+
// Set rules: only allow online attendance and MBA degree
|
|
217
|
+
for (const countryId of ['30', '21', '56', '82']) {
|
|
218
|
+
for (const attendanceId of ['online', 'face2face', 'blended']) {
|
|
219
|
+
for (const degreeId of ['mba', 'phd', 'masters']) {
|
|
220
|
+
const key = `${FilterKey.COUNTRY}:${countryId}|${FilterKey.DELIVERY_METHOD}:${attendanceId}|${FilterKey.DEGREE_TYPE}:${degreeId}`;
|
|
221
|
+
resultMap.set(key, attendanceId === 'online' && degreeId === 'mba');
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
sitemapDependenciesHelper.mockCheckRulesForSitemap(resultMap);
|
|
226
|
+
// Call the method via reflection since it's protected
|
|
227
|
+
const urls = await countryAttendanceDegreePolicy.generateUrls();
|
|
228
|
+
// Verify only online-MBA combinations were included
|
|
229
|
+
expect(urls).toHaveLength(4);
|
|
230
|
+
expect(urls).toContain('mba/online-programmes/uk');
|
|
231
|
+
expect(urls).toContain('mba/online-programmes/portugal');
|
|
232
|
+
expect(urls).toContain('mba/online-programmes/netherlands');
|
|
233
|
+
expect(urls).toContain('mba/online-programmes/usa');
|
|
234
|
+
expect(urls).not.toContain('mba/on-campus-programmes/uk');
|
|
235
|
+
expect(urls).not.toContain('phd/online-programmes/uk');
|
|
236
|
+
});
|
|
237
|
+
it('Should exclude certain country-attendance-degree combinations', async () => {
|
|
238
|
+
// Mock to exclude UK combinations
|
|
239
|
+
const resultMap = new Map();
|
|
240
|
+
// Set up rules to exclude UK for all attendance modes and degrees
|
|
241
|
+
for (const countryId of ['30', '21', '56', '82']) {
|
|
242
|
+
for (const attendanceId of ['online', 'face2face', 'blended']) {
|
|
243
|
+
for (const degreeId of ['mba', 'phd', 'masters']) {
|
|
244
|
+
const key = `${FilterKey.COUNTRY}:${countryId}|${FilterKey.DELIVERY_METHOD}:${attendanceId}|${FilterKey.DEGREE_TYPE}:${degreeId}`;
|
|
245
|
+
// Exclude UK (30) and only allow online+MBA for others
|
|
246
|
+
resultMap.set(key, countryId !== '30' && attendanceId === 'online' && degreeId === 'mba');
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
sitemapDependenciesHelper.mockCheckRulesForSitemap(resultMap);
|
|
251
|
+
const urls = await countryAttendanceDegreePolicy.generateUrls();
|
|
252
|
+
// Should include others but not UK
|
|
253
|
+
expect(urls).toHaveLength(3);
|
|
254
|
+
expect(urls).toContain('mba/online-programmes/portugal');
|
|
255
|
+
expect(urls).toContain('mba/online-programmes/usa');
|
|
256
|
+
expect(urls).toContain('mba/online-programmes/netherlands');
|
|
257
|
+
expect(urls).not.toContain('mba/online-programmes/uk');
|
|
258
|
+
});
|
|
259
|
+
it('Should exclude all URLs when all checks fail', async () => {
|
|
260
|
+
// Create a map that returns false for all combinations
|
|
261
|
+
const resultMap = new Map();
|
|
262
|
+
// Set all combinations to fail
|
|
263
|
+
for (const countryId of ['30', '21', '56', '82']) {
|
|
264
|
+
for (const attendanceId of ['online', 'face2face', 'blended']) {
|
|
265
|
+
for (const degreeId of ['mba', 'phd', 'masters']) {
|
|
266
|
+
const key = `${FilterKey.COUNTRY}:${countryId}|${FilterKey.DELIVERY_METHOD}:${attendanceId}|${FilterKey.DEGREE_TYPE}:${degreeId}`;
|
|
267
|
+
resultMap.set(key, false);
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
sitemapDependenciesHelper.mockCheckRulesForSitemap(resultMap, false);
|
|
272
|
+
const urls = await countryAttendanceDegreePolicy.generateUrls();
|
|
273
|
+
// Should include no URLs
|
|
274
|
+
expect(urls).toHaveLength(0);
|
|
275
|
+
});
|
|
276
|
+
it('Should handle empty fragments arrays', async () => {
|
|
277
|
+
// Mock the CountryPresenter to return empty fragments
|
|
278
|
+
CountryPresenter.getInstance.mockReturnValueOnce({
|
|
279
|
+
getFragments: vi.fn().mockReturnValue([])
|
|
280
|
+
});
|
|
281
|
+
sitemapDependenciesHelper.mockCheckRulesForSitemap();
|
|
282
|
+
const urls = await countryAttendanceDegreePolicy.generateUrls();
|
|
283
|
+
// Should return empty array
|
|
284
|
+
expect(urls).toHaveLength(0);
|
|
285
|
+
});
|
|
286
|
+
it('Should handle large number of combinations efficiently', async () => {
|
|
287
|
+
// Generate a smaller set of countries (10) and degree types (3) to avoid too many combinations
|
|
288
|
+
const largeCountrySet = Array.from({ length: 10 }, (_, index) => ({
|
|
289
|
+
id: `${1000 + index}`,
|
|
290
|
+
path: `country-${1000 + index}`
|
|
291
|
+
}));
|
|
292
|
+
const largeAttendanceSet = Array.from({ length: 3 }, (_, index) => ({
|
|
293
|
+
id: `attendance-${index}`,
|
|
294
|
+
path: `attendance-type-${index}`
|
|
295
|
+
}));
|
|
296
|
+
const largeDegreeSet = Array.from({ length: 3 }, (_, index) => ({
|
|
297
|
+
id: `degree-${index}`,
|
|
298
|
+
path: `degree-type-${index}`
|
|
299
|
+
}));
|
|
300
|
+
// Mock the presenters to return large sets
|
|
301
|
+
CountryPresenter.getInstance.mockReturnValueOnce({
|
|
302
|
+
getFragments: vi.fn().mockReturnValue(largeCountrySet)
|
|
303
|
+
});
|
|
304
|
+
AttendancePresenter.getInstance.mockReturnValueOnce({
|
|
305
|
+
getFragments: vi.fn().mockReturnValue(largeAttendanceSet)
|
|
306
|
+
});
|
|
307
|
+
DegreePresenter.getInstance.mockReturnValueOnce({
|
|
308
|
+
getFragments: vi.fn().mockReturnValue(largeDegreeSet)
|
|
309
|
+
});
|
|
310
|
+
// Mock to allow only specific combinations
|
|
311
|
+
// Only allow countries divisible by 2, attendance index 0, and degree index 0
|
|
312
|
+
const resultMap = new Map();
|
|
313
|
+
for (let c = 0; c < largeCountrySet.length; c++) {
|
|
314
|
+
for (let a = 0; a < largeAttendanceSet.length; a++) {
|
|
315
|
+
for (let d = 0; d < largeDegreeSet.length; d++) {
|
|
316
|
+
const countryId = largeCountrySet[c].id;
|
|
317
|
+
const attendanceId = largeAttendanceSet[a].id;
|
|
318
|
+
const degreeId = largeDegreeSet[d].id;
|
|
319
|
+
const key = `${FilterKey.COUNTRY}:${countryId}|${FilterKey.DELIVERY_METHOD}:${attendanceId}|${FilterKey.DEGREE_TYPE}:${degreeId}`;
|
|
320
|
+
// Only include countries where index is divisible by 2, and specific attendance and degree
|
|
321
|
+
resultMap.set(key, c % 2 === 0 && a === 0 && d === 0);
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
sitemapDependenciesHelper.mockCheckRulesForSitemap(resultMap);
|
|
326
|
+
const urls = await countryAttendanceDegreePolicy.generateUrls();
|
|
327
|
+
// Should generate 5 countries (10/2) * 1 attendance type * 1 degree type * page-2 variations = 10 URLs
|
|
328
|
+
expect(urls).toHaveLength(5);
|
|
329
|
+
// Test some specific combinations
|
|
330
|
+
expect(urls).toContain('degree-type-0/attendance-type-0/country-1000'); // First valid country
|
|
331
|
+
expect(urls).toContain('degree-type-0/attendance-type-0/country-1002'); // Another valid country
|
|
332
|
+
expect(urls).not.toContain('degree-type-0/attendance-type-0/country-1001'); // Invalid country (not divisible by 2)
|
|
333
|
+
expect(urls).not.toContain('degree-type-0/attendance-type-1/country-1000'); // Invalid attendance
|
|
334
|
+
expect(urls).not.toContain('degree-type-1/attendance-type-0/country-1000'); // Invalid degree
|
|
335
|
+
});
|
|
336
|
+
});
|
|
337
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,262 @@
|
|
|
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 { CountryDegree } from '@/programmes/policies/CountryDegree';
|
|
6
|
+
import { PortalType } from '@studyportals/domain-client';
|
|
7
|
+
import { CountryPresenter } from '@/presenters/CountryPresenter';
|
|
8
|
+
import { DegreePresenter } from '@/presenters/DegreePresenter';
|
|
9
|
+
describe('Policy:CountryDegree', () => {
|
|
10
|
+
describe('shouldIndex', () => {
|
|
11
|
+
let searchDependenciesHelper;
|
|
12
|
+
let countryDegreePolicy;
|
|
13
|
+
beforeEach(() => {
|
|
14
|
+
searchDependenciesHelper = new SearchDependencies();
|
|
15
|
+
countryDegreePolicy = new CountryDegree(searchDependenciesHelper.dependencies);
|
|
16
|
+
searchDependenciesHelper.setResultsCount(10);
|
|
17
|
+
searchDependenciesHelper.setPageNumber(1);
|
|
18
|
+
searchDependenciesHelper.setPortalType(PortalType.MASTER);
|
|
19
|
+
});
|
|
20
|
+
it('Should return true when all conditions are met', async () => {
|
|
21
|
+
const countryId = '30'; // UK
|
|
22
|
+
const degree = 'phd';
|
|
23
|
+
searchDependenciesHelper.setPortalType(PortalType.PHD);
|
|
24
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([
|
|
25
|
+
[FilterKey.COUNTRY, [countryId]],
|
|
26
|
+
[FilterKey.DEGREE_TYPE, [degree]]
|
|
27
|
+
]));
|
|
28
|
+
const result = await countryDegreePolicy.shouldIndex();
|
|
29
|
+
expect(result).toBe(true);
|
|
30
|
+
});
|
|
31
|
+
it('Should return false when multiple countries are selected', async () => {
|
|
32
|
+
const firstCountryId = '30'; // UK
|
|
33
|
+
const secondCountryId = '21'; // Portugal
|
|
34
|
+
const degree = 'mba';
|
|
35
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([
|
|
36
|
+
[FilterKey.COUNTRY, [firstCountryId, secondCountryId]],
|
|
37
|
+
[FilterKey.DEGREE_TYPE, [degree]]
|
|
38
|
+
]));
|
|
39
|
+
const result = await countryDegreePolicy.shouldIndex();
|
|
40
|
+
expect(result).toBe(false);
|
|
41
|
+
});
|
|
42
|
+
it('Should return false when multiple degree values are selected', async () => {
|
|
43
|
+
const countryId = '30'; // UK
|
|
44
|
+
const firstDegree = 'phd';
|
|
45
|
+
const secondDegree = 'mba';
|
|
46
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([
|
|
47
|
+
[FilterKey.COUNTRY, [countryId]],
|
|
48
|
+
[FilterKey.DEGREE_TYPE, [firstDegree, secondDegree]]
|
|
49
|
+
]));
|
|
50
|
+
const result = await countryDegreePolicy.shouldIndex();
|
|
51
|
+
expect(result).toBe(false);
|
|
52
|
+
});
|
|
53
|
+
it('Should return false when no degree values are selected', async () => {
|
|
54
|
+
const countryId = '30'; // UK
|
|
55
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([[FilterKey.COUNTRY, [countryId]]]));
|
|
56
|
+
const result = await countryDegreePolicy.shouldIndex();
|
|
57
|
+
expect(result).toBe(false);
|
|
58
|
+
});
|
|
59
|
+
it('Should return false when no countries are selected', async () => {
|
|
60
|
+
const degree = 'phd';
|
|
61
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([[FilterKey.DEGREE_TYPE, [degree]]]));
|
|
62
|
+
const result = await countryDegreePolicy.shouldIndex();
|
|
63
|
+
expect(result).toBe(false);
|
|
64
|
+
});
|
|
65
|
+
it('Should return false when other filters are selected', async () => {
|
|
66
|
+
const countryId = '30'; // UK
|
|
67
|
+
const degree = 'phd';
|
|
68
|
+
const disciplineId = '54'; // Agriculture & Forestry
|
|
69
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([
|
|
70
|
+
[FilterKey.COUNTRY, [countryId]],
|
|
71
|
+
[FilterKey.DEGREE_TYPE, [degree]],
|
|
72
|
+
[FilterKey.DISCIPLINES, [disciplineId]]
|
|
73
|
+
]));
|
|
74
|
+
const result = await countryDegreePolicy.shouldIndex();
|
|
75
|
+
expect(result).toBe(false);
|
|
76
|
+
});
|
|
77
|
+
it('Should return false when number of results is less than 7', async () => {
|
|
78
|
+
const countryId = '30'; // UK
|
|
79
|
+
const degree = 'phd';
|
|
80
|
+
searchDependenciesHelper.setResultsCount(6);
|
|
81
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([
|
|
82
|
+
[FilterKey.COUNTRY, [countryId]],
|
|
83
|
+
[FilterKey.DEGREE_TYPE, [degree]]
|
|
84
|
+
]));
|
|
85
|
+
const result = await countryDegreePolicy.shouldIndex();
|
|
86
|
+
expect(result).toBe(false);
|
|
87
|
+
});
|
|
88
|
+
it('Should return false when page number is higher than 2', async () => {
|
|
89
|
+
const countryId = '30'; // UK
|
|
90
|
+
const degree = 'phd';
|
|
91
|
+
searchDependenciesHelper.setPageNumber(3);
|
|
92
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([
|
|
93
|
+
[FilterKey.COUNTRY, [countryId]],
|
|
94
|
+
[FilterKey.DEGREE_TYPE, [degree]]
|
|
95
|
+
]));
|
|
96
|
+
const result = await countryDegreePolicy.shouldIndex();
|
|
97
|
+
expect(result).toBe(false);
|
|
98
|
+
});
|
|
99
|
+
it('Should return false when portal is distance learning', async () => {
|
|
100
|
+
const countryId = '30'; // UK
|
|
101
|
+
const degree = 'phd';
|
|
102
|
+
searchDependenciesHelper.setPortalType(PortalType.DISTANCE_LEARNING);
|
|
103
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([
|
|
104
|
+
[FilterKey.COUNTRY, [countryId]],
|
|
105
|
+
[FilterKey.DEGREE_TYPE, [degree]]
|
|
106
|
+
]));
|
|
107
|
+
const result = await countryDegreePolicy.shouldIndex();
|
|
108
|
+
expect(result).toBe(false);
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
describe('generateUrls', () => {
|
|
112
|
+
let sitemapDependenciesHelper;
|
|
113
|
+
let countryDegreePolicy;
|
|
114
|
+
beforeEach(() => {
|
|
115
|
+
sitemapDependenciesHelper = new SitemapDependencies();
|
|
116
|
+
sitemapDependenciesHelper.setProgrammeCount(10); // More than 7 programs
|
|
117
|
+
countryDegreePolicy = new CountryDegree(sitemapDependenciesHelper.dependencies);
|
|
118
|
+
CountryPresenter.getInstance = vi.fn().mockReturnValue({
|
|
119
|
+
getFragments: vi.fn().mockReturnValue([
|
|
120
|
+
{ id: '30', path: 'uk' },
|
|
121
|
+
{ id: '202', path: 'australia' },
|
|
122
|
+
{ id: '56', path: 'usa' }
|
|
123
|
+
])
|
|
124
|
+
});
|
|
125
|
+
DegreePresenter.getInstance = vi.fn().mockReturnValue({
|
|
126
|
+
getFragments: vi.fn().mockReturnValue([
|
|
127
|
+
{ id: 'mba', path: 'mba' },
|
|
128
|
+
{ id: 'msc', path: 'msc' },
|
|
129
|
+
{ id: 'phd', path: 'phd' },
|
|
130
|
+
{ id: 'adiploma', path: 'adiploma' } // Non-indexable degree
|
|
131
|
+
])
|
|
132
|
+
});
|
|
133
|
+
});
|
|
134
|
+
afterEach(() => {
|
|
135
|
+
sitemapDependenciesHelper.resetMocks();
|
|
136
|
+
});
|
|
137
|
+
it('Should generate URLs for valid country-degree combinations', async () => {
|
|
138
|
+
// Mock the checkRulesForSitemap to filter out adiploma for all countries
|
|
139
|
+
// due to IndexableDegreeRule
|
|
140
|
+
const resultMap = new Map();
|
|
141
|
+
// Set up all possible combinations
|
|
142
|
+
for (const country of ['30', '202', '56']) {
|
|
143
|
+
for (const degree of ['mba', 'msc', 'phd', 'adiploma']) {
|
|
144
|
+
const key = `${FilterKey.COUNTRY}:${country}|${FilterKey.DEGREE_TYPE}:${degree}`;
|
|
145
|
+
// adiploma should be filtered out by IndexableDegreeRule
|
|
146
|
+
resultMap.set(key, degree !== 'adiploma');
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
sitemapDependenciesHelper.mockCheckRulesForSitemap(resultMap);
|
|
150
|
+
// Call the method via reflection since it's protected
|
|
151
|
+
const urls = await countryDegreePolicy.generateUrls();
|
|
152
|
+
// Calculate expected URLs: 3 countries * 3 degrees (excluding adiploma) * 1 page = 9 URLs
|
|
153
|
+
expect(urls).toHaveLength(9);
|
|
154
|
+
// Verify paths structure
|
|
155
|
+
expect(urls).toContain('mba/uk');
|
|
156
|
+
expect(urls).toContain('msc/australia');
|
|
157
|
+
expect(urls).toContain('phd/usa');
|
|
158
|
+
// Verify adiploma is excluded
|
|
159
|
+
expect(urls).not.toContain('adiploma/uk');
|
|
160
|
+
expect(urls).not.toContain('adiploma/australia');
|
|
161
|
+
expect(urls).not.toContain('adiploma/usa');
|
|
162
|
+
});
|
|
163
|
+
it('Should exclude specific country-degree combinations based on rules', async () => {
|
|
164
|
+
// Create a map that returns false for specific combinations
|
|
165
|
+
const resultMap = new Map();
|
|
166
|
+
// Set UK with mba and USA with phd to fail, along with all adiploma combinations
|
|
167
|
+
for (const country of ['30', '202', '56']) {
|
|
168
|
+
for (const degree of ['mba', 'msc', 'phd', 'adiploma']) {
|
|
169
|
+
const key = `${FilterKey.COUNTRY}:${country}|${FilterKey.DEGREE_TYPE}:${degree}`;
|
|
170
|
+
const shouldPass = degree !== 'adiploma' && // All adiploma should fail
|
|
171
|
+
!(country === '30' && degree === 'mba') && // UK with MBA should fail
|
|
172
|
+
!(country === '56' && degree === 'phd'); // USA with PhD should fail
|
|
173
|
+
resultMap.set(key, shouldPass);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
sitemapDependenciesHelper.mockCheckRulesForSitemap(resultMap);
|
|
177
|
+
const urls = await countryDegreePolicy.generateUrls();
|
|
178
|
+
// Calculate expected URLs: 9 total combinations - 2 specific exclusions - 3 adiploma exclusions * 1 page = 7 URLs
|
|
179
|
+
expect(urls).toHaveLength(7);
|
|
180
|
+
// Verify excluded combinations
|
|
181
|
+
expect(urls).not.toContain('mba/uk');
|
|
182
|
+
expect(urls).not.toContain('phd/usa');
|
|
183
|
+
expect(urls).not.toContain('adiploma/uk');
|
|
184
|
+
// Verify included combinations
|
|
185
|
+
expect(urls).toContain('msc/uk');
|
|
186
|
+
expect(urls).toContain('phd/uk');
|
|
187
|
+
expect(urls).toContain('mba/usa');
|
|
188
|
+
});
|
|
189
|
+
it('Should exclude all URLs when all rule checks fail', async () => {
|
|
190
|
+
// Create a map that returns false for all combinations
|
|
191
|
+
const resultMap = new Map();
|
|
192
|
+
for (const country of ['30', '202', '56']) {
|
|
193
|
+
for (const degree of ['mba', 'msc', 'phd', 'adiploma']) {
|
|
194
|
+
const key = `${FilterKey.COUNTRY}:${country}|${FilterKey.DEGREE_TYPE}:${degree}`;
|
|
195
|
+
resultMap.set(key, false);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
sitemapDependenciesHelper.mockCheckRulesForSitemap(resultMap);
|
|
199
|
+
const urls = await countryDegreePolicy.generateUrls();
|
|
200
|
+
// Should include no URLs
|
|
201
|
+
expect(urls).toHaveLength(0);
|
|
202
|
+
});
|
|
203
|
+
it('Should handle empty country fragments', async () => {
|
|
204
|
+
// Mock the CountryPresenter to return empty fragments
|
|
205
|
+
CountryPresenter.getInstance.mockReturnValueOnce({
|
|
206
|
+
getFragments: vi.fn().mockReturnValue([])
|
|
207
|
+
});
|
|
208
|
+
sitemapDependenciesHelper.mockCheckRulesForSitemap();
|
|
209
|
+
const urls = await countryDegreePolicy.generateUrls();
|
|
210
|
+
// Should return empty array
|
|
211
|
+
expect(urls).toHaveLength(0);
|
|
212
|
+
});
|
|
213
|
+
it('Should handle empty degree fragments', async () => {
|
|
214
|
+
// Mock the DegreePresenter to return empty fragments
|
|
215
|
+
DegreePresenter.getInstance.mockReturnValueOnce({
|
|
216
|
+
getFragments: vi.fn().mockReturnValue([])
|
|
217
|
+
});
|
|
218
|
+
sitemapDependenciesHelper.mockCheckRulesForSitemap();
|
|
219
|
+
const urls = await countryDegreePolicy.generateUrls();
|
|
220
|
+
// Should return empty array
|
|
221
|
+
expect(urls).toHaveLength(0);
|
|
222
|
+
});
|
|
223
|
+
it('Should handle performance with large number of combinations', async () => {
|
|
224
|
+
// Generate larger datasets for testing
|
|
225
|
+
const largeCountrySet = Array.from({ length: 20 }, (_, index) => ({
|
|
226
|
+
id: `country-${index}`,
|
|
227
|
+
path: `country-path-${index}`
|
|
228
|
+
}));
|
|
229
|
+
const largeDegreeSet = Array.from({ length: 10 }, (_, index) => ({
|
|
230
|
+
id: `degree-${index}`,
|
|
231
|
+
path: `degree-path-${index}`
|
|
232
|
+
}));
|
|
233
|
+
// Override mocks with large datasets
|
|
234
|
+
CountryPresenter.getInstance.mockReturnValueOnce({
|
|
235
|
+
getFragments: vi.fn().mockReturnValue(largeCountrySet)
|
|
236
|
+
});
|
|
237
|
+
DegreePresenter.getInstance.mockReturnValueOnce({
|
|
238
|
+
getFragments: vi.fn().mockReturnValue(largeDegreeSet)
|
|
239
|
+
});
|
|
240
|
+
// Mock to allow only combinations where both country and degree indices are even
|
|
241
|
+
const resultMap = new Map();
|
|
242
|
+
for (let c = 0; c < largeCountrySet.length; c++) {
|
|
243
|
+
for (let d = 0; d < largeDegreeSet.length; d++) {
|
|
244
|
+
const countryId = largeCountrySet[c].id;
|
|
245
|
+
const degreeId = largeDegreeSet[d].id;
|
|
246
|
+
const key = `${FilterKey.COUNTRY}:${countryId}|${FilterKey.DEGREE_TYPE}:${degreeId}`;
|
|
247
|
+
resultMap.set(key, c % 2 === 0 && d % 2 === 0);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
sitemapDependenciesHelper.mockCheckRulesForSitemap(resultMap, false);
|
|
251
|
+
const urls = await countryDegreePolicy.generateUrls();
|
|
252
|
+
// Calculate expected count: 10 countries (even indices) * 5 degrees (even indices)
|
|
253
|
+
// 10 * 5 = 50 URLs
|
|
254
|
+
expect(urls).toHaveLength(50);
|
|
255
|
+
// Test specific items
|
|
256
|
+
expect(urls).toContain('degree-path-0/country-path-0'); // Both even indices
|
|
257
|
+
expect(urls).toContain('degree-path-2/country-path-4'); // Both even indices
|
|
258
|
+
expect(urls).not.toContain('degree-path-1/country-path-0'); // Odd degree index
|
|
259
|
+
expect(urls).not.toContain('degree-path-0/country-path-1'); // Odd country index
|
|
260
|
+
});
|
|
261
|
+
});
|
|
262
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|