@studyportals/fawkes 8.7.1-0 → 8.7.1
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 +1 -1
- 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/DegreeTuitionFeeArea.d.ts +3 -3
- package/dist/src/programmes/policies/DegreeTuitionFeeArea.js +6 -6
- package/dist/src/programmes/policies/DegreeTuitionFeeAttendance.d.ts +2 -2
- package/dist/src/programmes/policies/DegreeTuitionFeeAttendance.js +7 -7
- package/dist/src/programmes/policies/DegreeTuitionFeeContinent.d.ts +2 -2
- package/dist/src/programmes/policies/DegreeTuitionFeeContinent.js +6 -6
- package/dist/src/programmes/policies/DegreeTuitionFeeFormat.d.ts +2 -2
- package/dist/src/programmes/policies/DegreeTuitionFeeFormat.js +6 -6
- 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/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 +13 -13
- 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/package.json +1 -1
- package/dist/tests/common/rules/NoFiltersSelectedRule.test.d.mts +0 -1
- package/dist/tests/common/rules/NoFiltersSelectedRule.test.mjs +0 -40
- package/dist/tests/common/rules/OnlyFiltersSelectedRule.test.d.mts +0 -1
- package/dist/tests/common/rules/OnlyFiltersSelectedRule.test.mjs +0 -70
- package/dist/tests/common/rules/SingleValueSelectedForFilterRule.test.d.mts +0 -1
- package/dist/tests/common/rules/SingleValueSelectedForFilterRule.test.mjs +0 -54
- package/dist/tests/organisations/policies/our-picks/Area.test.d.mts +0 -1
- package/dist/tests/organisations/policies/our-picks/Area.test.mjs +0 -125
- package/dist/tests/organisations/policies/our-picks/AreaAttendance.test.d.mts +0 -1
- package/dist/tests/organisations/policies/our-picks/AreaAttendance.test.mjs +0 -238
- package/dist/tests/organisations/policies/our-picks/Attendance.test.d.mts +0 -1
- package/dist/tests/organisations/policies/our-picks/Attendance.test.mjs +0 -119
- package/dist/tests/organisations/policies/our-picks/Continent.test.d.mts +0 -1
- package/dist/tests/organisations/policies/our-picks/Continent.test.mjs +0 -105
- package/dist/tests/organisations/policies/our-picks/Country.test.d.mts +0 -1
- package/dist/tests/organisations/policies/our-picks/Country.test.mjs +0 -109
- package/dist/tests/organisations/policies/our-picks/CountryAreaCity.test.d.mts +0 -1
- package/dist/tests/organisations/policies/our-picks/CountryAreaCity.test.mjs +0 -152
- package/dist/tests/organisations/policies/our-picks/CountryAttendance.test.d.mts +0 -1
- package/dist/tests/organisations/policies/our-picks/CountryAttendance.test.mjs +0 -223
- package/dist/tests/organisations/policies/our-picks/CountryCity.test.d.mts +0 -1
- package/dist/tests/organisations/policies/our-picks/CountryCity.test.mjs +0 -109
- package/dist/tests/organisations/policies/our-picks/Unfiltered.test.d.mts +0 -1
- package/dist/tests/organisations/policies/our-picks/Unfiltered.test.mjs +0 -60
- package/dist/tests/organisations/policies/ranked/RankedArea.test.d.mts +0 -1
- package/dist/tests/organisations/policies/ranked/RankedArea.test.mjs +0 -149
- package/dist/tests/organisations/policies/ranked/RankedAreaDiscipline.test.d.mts +0 -1
- package/dist/tests/organisations/policies/ranked/RankedAreaDiscipline.test.mjs +0 -237
- package/dist/tests/organisations/policies/ranked/RankedAttendance.test.d.mts +0 -1
- package/dist/tests/organisations/policies/ranked/RankedAttendance.test.mjs +0 -139
- package/dist/tests/organisations/policies/ranked/RankedAttendanceDiscipline.test.d.mts +0 -1
- package/dist/tests/organisations/policies/ranked/RankedAttendanceDiscipline.test.mjs +0 -224
- package/dist/tests/organisations/policies/ranked/RankedContinent.test.d.mts +0 -1
- package/dist/tests/organisations/policies/ranked/RankedContinent.test.mjs +0 -125
- package/dist/tests/organisations/policies/ranked/RankedContinentAttendance.test.d.mts +0 -1
- package/dist/tests/organisations/policies/ranked/RankedContinentAttendance.test.mjs +0 -253
- package/dist/tests/organisations/policies/ranked/RankedCountry.test.d.mts +0 -1
- package/dist/tests/organisations/policies/ranked/RankedCountry.test.mjs +0 -131
- package/dist/tests/organisations/policies/ranked/RankedCountryAttendance.test.d.mts +0 -1
- package/dist/tests/organisations/policies/ranked/RankedCountryAttendance.test.mjs +0 -230
- package/dist/tests/organisations/policies/ranked/RankedCountryDiscipline.test.d.mts +0 -1
- package/dist/tests/organisations/policies/ranked/RankedCountryDiscipline.test.mjs +0 -197
- package/dist/tests/organisations/policies/ranked/RankedDiscipline.test.d.mts +0 -1
- package/dist/tests/organisations/policies/ranked/RankedDiscipline.test.mjs +0 -124
- package/dist/tests/organisations/policies/ranked/RankedUnfiltered.test.d.mts +0 -1
- package/dist/tests/organisations/policies/ranked/RankedUnfiltered.test.mjs +0 -75
- package/dist/tests/organisations/rules/ContinentIsEuropeRule.test.d.mts +0 -1
- package/dist/tests/organisations/rules/ContinentIsEuropeRule.test.mjs +0 -59
- package/dist/tests/organisations/rules/MinimumAmountOfRankedResultsRule.test.d.mts +0 -1
- package/dist/tests/organisations/rules/MinimumAmountOfRankedResultsRule.test.mjs +0 -77
- package/dist/tests/organisations/rules/MinimumAmountOfResultsRule.test.d.mts +0 -1
- package/dist/tests/organisations/rules/MinimumAmountOfResultsRule.test.mjs +0 -77
- package/dist/tests/organisations/rules/OnlineAttendanceRule.test.d.mts +0 -1
- package/dist/tests/organisations/rules/OnlineAttendanceRule.test.mjs +0 -59
- package/dist/tests/organisations/rules/SearchVolumeAreasAttendanceRule.test.d.mts +0 -1
- package/dist/tests/organisations/rules/SearchVolumeAreasAttendanceRule.test.mjs +0 -59
- package/dist/tests/organisations/rules/SearchVolumeAreasDisciplineRule.test.d.mts +0 -1
- package/dist/tests/organisations/rules/SearchVolumeAreasDisciplineRule.test.mjs +0 -59
- package/dist/tests/organisations/rules/SearchVolumeCountriesAttendanceRule.test.d.mts +0 -1
- package/dist/tests/organisations/rules/SearchVolumeCountriesAttendanceRule.test.mjs +0 -59
- package/dist/tests/organisations/utils/SearchDependencies.util.d.mts +0 -20
- package/dist/tests/organisations/utils/SearchDependencies.util.mjs +0 -88
- package/dist/tests/organisations/utils/SitemapDependencies.util.d.mts +0 -18
- package/dist/tests/organisations/utils/SitemapDependencies.util.mjs +0 -54
- package/dist/tests/presenters/AreaPresenter.test.d.mts +0 -1
- package/dist/tests/presenters/AreaPresenter.test.mjs +0 -46
- package/dist/tests/presenters/AttendancePresenter.test.d.mts +0 -1
- package/dist/tests/presenters/AttendancePresenter.test.mjs +0 -41
- package/dist/tests/presenters/ContinentPresenter.test.d.mts +0 -1
- package/dist/tests/presenters/ContinentPresenter.test.mjs +0 -44
- package/dist/tests/presenters/CountryPresenter.test.d.mts +0 -1
- package/dist/tests/presenters/CountryPresenter.test.mjs +0 -50
- package/dist/tests/presenters/DegreePresenter.test.d.mts +0 -1
- package/dist/tests/presenters/DegreePresenter.test.mjs +0 -51
- package/dist/tests/presenters/DisciplinePresenter.test.d.mts +0 -1
- package/dist/tests/presenters/DisciplinePresenter.test.mjs +0 -40
- package/dist/tests/presenters/DurationPresenter.test.d.mts +0 -1
- package/dist/tests/presenters/DurationPresenter.test.mjs +0 -64
- package/dist/tests/presenters/EducationalFormPresenter.test.d.mts +0 -1
- package/dist/tests/presenters/EducationalFormPresenter.test.mjs +0 -60
- package/dist/tests/presenters/FormatPresenter.test.d.mts +0 -1
- package/dist/tests/presenters/FormatPresenter.test.mjs +0 -43
- package/dist/tests/presenters/SpecialProgrammesPresenter.test.d.mts +0 -1
- package/dist/tests/presenters/SpecialProgrammesPresenter.test.mjs +0 -66
- package/dist/tests/presenters/TuitionFeePresenter.test.d.mts +0 -1
- package/dist/tests/presenters/TuitionFeePresenter.test.mjs +0 -52
- package/dist/tests/programmes/policies/Area.test.d.mts +0 -1
- package/dist/tests/programmes/policies/Area.test.mjs +0 -153
- package/dist/tests/programmes/policies/Attendance.test.d.mts +0 -1
- package/dist/tests/programmes/policies/Attendance.test.mjs +0 -173
- package/dist/tests/programmes/policies/AttendanceDegree.test.d.mts +0 -1
- package/dist/tests/programmes/policies/AttendanceDegree.test.mjs +0 -291
- package/dist/tests/programmes/policies/Continent.test.d.mts +0 -1
- package/dist/tests/programmes/policies/Continent.test.mjs +0 -169
- package/dist/tests/programmes/policies/Country.test.d.mts +0 -1
- package/dist/tests/programmes/policies/Country.test.mjs +0 -164
- package/dist/tests/programmes/policies/CountryAttendance.test.d.mts +0 -1
- package/dist/tests/programmes/policies/CountryAttendance.test.mjs +0 -251
- package/dist/tests/programmes/policies/CountryAttendanceDegree.test.d.mts +0 -1
- package/dist/tests/programmes/policies/CountryAttendanceDegree.test.mjs +0 -337
- package/dist/tests/programmes/policies/CountryDegree.test.d.mts +0 -1
- package/dist/tests/programmes/policies/CountryDegree.test.mjs +0 -262
- package/dist/tests/programmes/policies/CountryDuration.test.d.mts +0 -1
- package/dist/tests/programmes/policies/CountryDuration.test.mjs +0 -234
- package/dist/tests/programmes/policies/CountryDurationDegree.test.d.mts +0 -1
- package/dist/tests/programmes/policies/CountryDurationDegree.test.mjs +0 -304
- package/dist/tests/programmes/policies/CountryEducationalForm.test.d.mts +0 -1
- package/dist/tests/programmes/policies/CountryEducationalForm.test.mjs +0 -260
- package/dist/tests/programmes/policies/CountryFormat.test.d.mts +0 -1
- package/dist/tests/programmes/policies/CountryFormat.test.mjs +0 -253
- package/dist/tests/programmes/policies/DegreeAttendanceDiscipline.test.d.mts +0 -1
- package/dist/tests/programmes/policies/DegreeAttendanceDiscipline.test.mjs +0 -179
- package/dist/tests/programmes/policies/DegreeCountryAttendance.test.d.mts +0 -1
- package/dist/tests/programmes/policies/DegreeCountryAttendance.test.mjs +0 -267
- package/dist/tests/programmes/policies/DegreeCountryTuitionFee.test.d.mts +0 -1
- package/dist/tests/programmes/policies/DegreeCountryTuitionFee.test.mjs +0 -217
- package/dist/tests/programmes/policies/DegreeFormat.test.d.mts +0 -1
- package/dist/tests/programmes/policies/DegreeFormat.test.mjs +0 -221
- package/dist/tests/programmes/policies/Discipline.test.d.mts +0 -1
- package/dist/tests/programmes/policies/Discipline.test.mjs +0 -159
- package/dist/tests/programmes/policies/DisciplineAttendance.test.d.mts +0 -1
- package/dist/tests/programmes/policies/DisciplineAttendance.test.mjs +0 -292
- package/dist/tests/programmes/policies/DisciplineContinent.test.d.mts +0 -1
- package/dist/tests/programmes/policies/DisciplineContinent.test.mjs +0 -253
- package/dist/tests/programmes/policies/DisciplineCountry.test.d.mts +0 -1
- package/dist/tests/programmes/policies/DisciplineCountry.test.mjs +0 -244
- package/dist/tests/programmes/policies/DisciplineCountryEducationalForm.test.d.mts +0 -1
- package/dist/tests/programmes/policies/DisciplineCountryEducationalForm.test.mjs +0 -345
- package/dist/tests/programmes/policies/DisciplineDegree.test.d.mts +0 -1
- package/dist/tests/programmes/policies/DisciplineDegree.test.mjs +0 -273
- package/dist/tests/programmes/policies/DisciplineDuration.test.d.mts +0 -1
- package/dist/tests/programmes/policies/DisciplineDuration.test.mjs +0 -278
- package/dist/tests/programmes/policies/DisciplineEducationalForm.test.d.mts +0 -1
- package/dist/tests/programmes/policies/DisciplineEducationalForm.test.mjs +0 -302
- package/dist/tests/programmes/policies/DisciplineFormat.test.d.mts +0 -1
- package/dist/tests/programmes/policies/DisciplineFormat.test.mjs +0 -266
- package/dist/tests/programmes/policies/Duration.test.d.mts +0 -1
- package/dist/tests/programmes/policies/Duration.test.mjs +0 -179
- package/dist/tests/programmes/policies/Format.test.d.mts +0 -1
- package/dist/tests/programmes/policies/Format.test.mjs +0 -117
- package/dist/tests/programmes/policies/NewRulesValidation.test.d.mts +0 -1
- package/dist/tests/programmes/policies/NewRulesValidation.test.mjs +0 -320
- package/dist/tests/programmes/policies/SpecialProgrammes.test.d.mts +0 -1
- package/dist/tests/programmes/policies/SpecialProgrammes.test.mjs +0 -171
- package/dist/tests/programmes/policies/TuitionFeeAttendanceDiscipline.test.d.mts +0 -1
- package/dist/tests/programmes/policies/TuitionFeeAttendanceDiscipline.test.mjs +0 -360
- package/dist/tests/programmes/policies/TuitionFeeContinent.test.d.mts +0 -1
- package/dist/tests/programmes/policies/TuitionFeeContinent.test.mjs +0 -293
- package/dist/tests/programmes/policies/TuitionFeeCountry.test.d.mts +0 -1
- package/dist/tests/programmes/policies/TuitionFeeCountry.test.mjs +0 -266
- package/dist/tests/programmes/policies/TuitionFeeDiscipline.test.d.mts +0 -1
- package/dist/tests/programmes/policies/TuitionFeeDiscipline.test.mjs +0 -267
- package/dist/tests/programmes/policies/Unfiltered.test.d.mts +0 -1
- package/dist/tests/programmes/policies/Unfiltered.test.mjs +0 -90
- package/dist/tests/programmes/rules/AffordableTuitionFeeRule.test.d.mts +0 -1
- package/dist/tests/programmes/rules/AffordableTuitionFeeRule.test.mjs +0 -27
- package/dist/tests/programmes/rules/DegreeCountrySpecificRule.test.d.mts +0 -1
- package/dist/tests/programmes/rules/DegreeCountrySpecificRule.test.mjs +0 -121
- package/dist/tests/programmes/rules/DegreeDisciplineRule.test.d.mts +0 -1
- package/dist/tests/programmes/rules/DegreeDisciplineRule.test.mjs +0 -169
- package/dist/tests/programmes/rules/IndexableDegreeRule.test.d.mts +0 -1
- package/dist/tests/programmes/rules/IndexableDegreeRule.test.mjs +0 -101
- package/dist/tests/programmes/rules/IndexableDurationRule.test..d.mts +0 -1
- package/dist/tests/programmes/rules/IndexableDurationRule.test..mjs +0 -25
- package/dist/tests/programmes/rules/IndexableEducationalFormRule.test.d.mts +0 -1
- package/dist/tests/programmes/rules/IndexableEducationalFormRule.test.mjs +0 -27
- package/dist/tests/programmes/rules/IndexablePageNumberRule.test.d.mts +0 -1
- package/dist/tests/programmes/rules/IndexablePageNumberRule.test.mjs +0 -51
- package/dist/tests/programmes/rules/MbaDegreeRule.test.d.mts +0 -1
- package/dist/tests/programmes/rules/MbaDegreeRule.test.mjs +0 -55
- package/dist/tests/programmes/rules/MbaOrMscDegreeRule.test.d.mts +0 -1
- package/dist/tests/programmes/rules/MbaOrMscDegreeRule.test.mjs +0 -53
- package/dist/tests/programmes/rules/MinimumAmountOfResultsRule.test.d.mts +0 -1
- package/dist/tests/programmes/rules/MinimumAmountOfResultsRule.test.mjs +0 -79
- package/dist/tests/programmes/rules/NotDistanceLearningPortalRule.test.d.mts +0 -1
- package/dist/tests/programmes/rules/NotDistanceLearningPortalRule.test.mjs +0 -57
- package/dist/tests/programmes/rules/OneYearDurationRule.test..d.mts +0 -1
- package/dist/tests/programmes/rules/OneYearDurationRule.test..mjs +0 -40
- package/dist/tests/programmes/rules/OnlineAttendanceRule.test.d.mts +0 -1
- package/dist/tests/programmes/rules/OnlineAttendanceRule.test.mjs +0 -69
- package/dist/tests/programmes/rules/PartTimeFormatRule.test.d.mts +0 -1
- package/dist/tests/programmes/rules/PartTimeFormatRule.test.mjs +0 -27
- package/dist/tests/programmes/utils/SearchDependencies.util.d.mts +0 -16
- package/dist/tests/programmes/utils/SearchDependencies.util.mjs +0 -73
- package/dist/tests/programmes/utils/SitemapDependencies.util.d.mts +0 -15
- package/dist/tests/programmes/utils/SitemapDependencies.util.mjs +0 -49
- package/dist/tests/scholarships/policies/Area.test.d.mts +0 -1
- package/dist/tests/scholarships/policies/Area.test.mjs +0 -121
- package/dist/tests/scholarships/policies/Country.test.d.mts +0 -1
- package/dist/tests/scholarships/policies/Country.test.mjs +0 -97
- package/dist/tests/scholarships/policies/Discipline.test.d.mts +0 -1
- package/dist/tests/scholarships/policies/Discipline.test.mjs +0 -93
- package/dist/tests/scholarships/policies/DisciplineCountry.test.d.mts +0 -1
- package/dist/tests/scholarships/policies/DisciplineCountry.test.mjs +0 -151
- package/dist/tests/scholarships/policies/Unfiltered.test.d.mts +0 -1
- package/dist/tests/scholarships/policies/Unfiltered.test.mjs +0 -44
- package/dist/tests/scholarships/policies/UniversityCountry.test.d.mts +0 -1
- package/dist/tests/scholarships/policies/UniversityCountry.test.mjs +0 -115
- package/dist/tests/scholarships/rules/ExceptAustaliaAreasRule.test.d.mts +0 -1
- package/dist/tests/scholarships/rules/ExceptAustaliaAreasRule.test.mjs +0 -64
- package/dist/tests/scholarships/rules/SearchVolumeAreasRule.test.d.mts +0 -1
- package/dist/tests/scholarships/rules/SearchVolumeAreasRule.test.mjs +0 -62
- package/dist/tests/scholarships/rules/SearchVolumeCountriesDisciplinesRule.test.d.mts +0 -1
- package/dist/tests/scholarships/rules/SearchVolumeCountriesDisciplinesRule.test.mjs +0 -114
- package/dist/tests/scholarships/rules/SearchVolumeCountriesRule.test.d.mts +0 -1
- package/dist/tests/scholarships/rules/SearchVolumeCountriesRule.test.mjs +0 -62
- package/dist/tests/scholarships/rules/SearchVolumeDisciplinesRule.test.d.mts +0 -1
- package/dist/tests/scholarships/rules/SearchVolumeDisciplinesRule.test.mjs +0 -62
- package/dist/tests/scholarships/utils/SearchDependencies.util.d.mts +0 -16
- package/dist/tests/scholarships/utils/SearchDependencies.util.mjs +0 -70
- package/dist/tests/scholarships/utils/SitemapDependencies.util.d.mts +0 -11
- package/dist/tests/scholarships/utils/SitemapDependencies.util.mjs +0 -33
- package/dist/tests/sitemap-generator/BaseSitemapUrlGeneratorManager.test.d.mts +0 -1
- package/dist/tests/sitemap-generator/BaseSitemapUrlGeneratorManager.test.mjs +0 -82
- package/dist/tests/sitemap-generator/OrganisationsSitemapUrlGeneratorManager.test.d.mts +0 -1
- package/dist/tests/sitemap-generator/OrganisationsSitemapUrlGeneratorManager.test.mjs +0 -85
- package/dist/tests/sitemap-generator/ProgrammesSitemapUrlGeneratorManager.test.d.mts +0 -1
- package/dist/tests/sitemap-generator/ProgrammesSitemapUrlGeneratorManager.test.mjs +0 -77
- package/dist/tests/sitemap-generator/ScholarshipsSitemapUrlGeneratorManager.test.d.mts +0 -1
- package/dist/tests/sitemap-generator/ScholarshipsSitemapUrlGeneratorManager.test.mjs +0 -60
- package/dist/tests/structured-data/OrganisationStructuredDataFactory.test.d.mts +0 -1
- package/dist/tests/structured-data/OrganisationStructuredDataFactory.test.mjs +0 -334
- package/dist/tests/structured-data/ProgrammeStructuredDataFactory.test.d.mts +0 -1
- package/dist/tests/structured-data/ProgrammeStructuredDataFactory.test.mjs +0 -562
- package/dist/tests/structured-data/ScholarshipStructuredDataFactory.test.d.mts +0 -1
- package/dist/tests/structured-data/ScholarshipStructuredDataFactory.test.mjs +0 -292
- package/dist/tests/structured-data/SearchStructuredDataFactory.paywall.test.d.mts +0 -1
- package/dist/tests/structured-data/SearchStructuredDataFactory.paywall.test.mjs +0 -258
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { beforeEach, describe, expect, it } from 'vitest';
|
|
2
|
-
import { SearchDependencies } from '../utils/SearchDependencies.util.mjs';
|
|
3
|
-
import { SearchVolumeDisciplinesRule } from '@/scholarships/rules/SearchVolumeDisciplinesRule';
|
|
4
|
-
import { FilterKey } from '@studyportals/search-filters/server-side';
|
|
5
|
-
describe('Rule:SearchVolumeAreas', () => {
|
|
6
|
-
describe('forSearch', () => {
|
|
7
|
-
let searchDependenciesHelper;
|
|
8
|
-
let rule;
|
|
9
|
-
beforeEach(() => {
|
|
10
|
-
searchDependenciesHelper = new SearchDependencies();
|
|
11
|
-
rule = new SearchVolumeDisciplinesRule();
|
|
12
|
-
});
|
|
13
|
-
it('Returns true if discipline has search volume', async () => {
|
|
14
|
-
const disciplineId = '54'; // Agriculture & Forestry
|
|
15
|
-
searchDependenciesHelper.setFilterKeyValues(new Map([[FilterKey.DISCIPLINES, [disciplineId]]]));
|
|
16
|
-
const result = await rule.forSearch(searchDependenciesHelper.dependencies);
|
|
17
|
-
expect(result).toBe(true);
|
|
18
|
-
});
|
|
19
|
-
it('Returns false if discipline does not have search volume', async () => {
|
|
20
|
-
const disciplineId = '243'; // Master in Management
|
|
21
|
-
searchDependenciesHelper.setFilterKeyValues(new Map([[FilterKey.DISCIPLINES, [disciplineId]]]));
|
|
22
|
-
const result = await rule.forSearch(searchDependenciesHelper.dependencies);
|
|
23
|
-
expect(result).toBe(false);
|
|
24
|
-
});
|
|
25
|
-
});
|
|
26
|
-
describe('forSitemapGenerator', () => {
|
|
27
|
-
let rule;
|
|
28
|
-
beforeEach(() => {
|
|
29
|
-
rule = new SearchVolumeDisciplinesRule();
|
|
30
|
-
});
|
|
31
|
-
it('Returns true if discipline has search volume', async () => {
|
|
32
|
-
const disciplineId = '54'; // Agriculture & Forestry
|
|
33
|
-
const result = await rule.forSitemapGenerator(new Map([[FilterKey.DISCIPLINES, [disciplineId]]]));
|
|
34
|
-
expect(result).toBe(true);
|
|
35
|
-
});
|
|
36
|
-
it('Returns false if discipline does not have search volume', async () => {
|
|
37
|
-
const disciplineId = '243'; // Master in Management
|
|
38
|
-
const result = await rule.forSitemapGenerator(new Map([[FilterKey.DISCIPLINES, [disciplineId]]]));
|
|
39
|
-
expect(result).toBe(false);
|
|
40
|
-
});
|
|
41
|
-
it('Returns false if multiple disciplines are selected', async () => {
|
|
42
|
-
const firstCountryId = '30'; // UK
|
|
43
|
-
const secondCountryId = '82'; // USA
|
|
44
|
-
const result = await rule.forSitemapGenerator(new Map([[FilterKey.DISCIPLINES, [firstCountryId, secondCountryId]]]));
|
|
45
|
-
expect(result).toBe(false);
|
|
46
|
-
});
|
|
47
|
-
});
|
|
48
|
-
describe('forDocumentation', () => {
|
|
49
|
-
let rule;
|
|
50
|
-
beforeEach(() => {
|
|
51
|
-
rule = new SearchVolumeDisciplinesRule();
|
|
52
|
-
});
|
|
53
|
-
it('Returns description', () => {
|
|
54
|
-
const result = rule.getName();
|
|
55
|
-
expect(typeof result).toBe('string');
|
|
56
|
-
});
|
|
57
|
-
it('Returns name', () => {
|
|
58
|
-
const result = rule.getDescription();
|
|
59
|
-
expect(typeof result).toBe('string');
|
|
60
|
-
});
|
|
61
|
-
});
|
|
62
|
-
});
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { FilterKeyValuesMap } from '@/common/FilterKeyValuesMap';
|
|
2
|
-
import { ISearchApplicationState } from '@/common/ISearchApplicationState';
|
|
3
|
-
import { ISearchDependencies } from '@/common/ISearchDependencies';
|
|
4
|
-
import { DependencyTypes } from '@/enums/DependencyTypes';
|
|
5
|
-
import { ISeoFilterState, ISeoInfoBase } from 'scholarships-seo';
|
|
6
|
-
export declare class SearchDependencies {
|
|
7
|
-
dependencies: ISearchDependencies;
|
|
8
|
-
constructor();
|
|
9
|
-
get seoInfoBase(): ISeoInfoBase;
|
|
10
|
-
get filterState(): ISeoFilterState;
|
|
11
|
-
get applicationState(): ISearchApplicationState;
|
|
12
|
-
get dependencyType(): DependencyTypes;
|
|
13
|
-
setPageNumber(pageNumber: number): void;
|
|
14
|
-
setNumberOfResults(count: number): void;
|
|
15
|
-
setFilterKeyValues(filterKeyValues: FilterKeyValuesMap): void;
|
|
16
|
-
}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { DependencyTypes } from '@/enums/DependencyTypes';
|
|
2
|
-
import { vi } from 'vitest';
|
|
3
|
-
export class SearchDependencies {
|
|
4
|
-
dependencies;
|
|
5
|
-
constructor() {
|
|
6
|
-
const seoInfoBase = {
|
|
7
|
-
singleSelectionFor: vi.fn(),
|
|
8
|
-
selectionOnlyFor: vi.fn(),
|
|
9
|
-
getFilterOptionValueBy: vi.fn(),
|
|
10
|
-
getSelectionTypeCount: vi.fn()
|
|
11
|
-
};
|
|
12
|
-
const filterState = {};
|
|
13
|
-
const applicationState = {
|
|
14
|
-
getPageNumber: vi.fn().mockReturnValue(1),
|
|
15
|
-
getNumberOfResults: vi.fn().mockReturnValue(0)
|
|
16
|
-
};
|
|
17
|
-
const dependencyType = DependencyTypes.SEARCH;
|
|
18
|
-
this.dependencies = {
|
|
19
|
-
seoInfoBase,
|
|
20
|
-
filterState,
|
|
21
|
-
applicationState,
|
|
22
|
-
dependencyType
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
get seoInfoBase() {
|
|
26
|
-
return this.dependencies.seoInfoBase;
|
|
27
|
-
}
|
|
28
|
-
get filterState() {
|
|
29
|
-
return this.dependencies.filterState;
|
|
30
|
-
}
|
|
31
|
-
get applicationState() {
|
|
32
|
-
return this.dependencies.applicationState;
|
|
33
|
-
}
|
|
34
|
-
get dependencyType() {
|
|
35
|
-
return this.dependencies.dependencyType;
|
|
36
|
-
}
|
|
37
|
-
setPageNumber(pageNumber) {
|
|
38
|
-
this.dependencies.applicationState.getPageNumber.mockImplementation(() => {
|
|
39
|
-
return pageNumber;
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
setNumberOfResults(count) {
|
|
43
|
-
this.dependencies.applicationState.getNumberOfResults.mockImplementation(() => {
|
|
44
|
-
return count;
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
setFilterKeyValues(filterKeyValues) {
|
|
48
|
-
const filterKeys = Array.from(filterKeyValues.keys());
|
|
49
|
-
this.dependencies.seoInfoBase.singleSelectionFor.mockImplementation((key) => {
|
|
50
|
-
if (filterKeys.includes(key)) {
|
|
51
|
-
return filterKeyValues.get(key).length === 1;
|
|
52
|
-
}
|
|
53
|
-
return false;
|
|
54
|
-
});
|
|
55
|
-
this.dependencies.seoInfoBase.selectionOnlyFor.mockImplementation((keys) => {
|
|
56
|
-
if (keys.every((key) => filterKeys.includes(key)) && filterKeys.every((filterKey) => keys.includes(filterKey)))
|
|
57
|
-
return true;
|
|
58
|
-
return false;
|
|
59
|
-
});
|
|
60
|
-
this.dependencies.seoInfoBase.getFilterOptionValueBy.mockImplementation((key) => {
|
|
61
|
-
const values = filterKeyValues.get(key);
|
|
62
|
-
if (!values || values.length === 0)
|
|
63
|
-
return null;
|
|
64
|
-
return values[0];
|
|
65
|
-
});
|
|
66
|
-
this.dependencies.seoInfoBase.getSelectionTypeCount.mockImplementation(() => {
|
|
67
|
-
return filterKeys.length;
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { IScholarshipSitemapDependencies } from '@/scholarships/types/IScholarshipSitemapDependencies';
|
|
2
|
-
import { DependencyTypes } from '@/enums/DependencyTypes';
|
|
3
|
-
import { IOrganisation, IOrganisationsClient, ISearchApiClient } from 'sitemap-generator-seo';
|
|
4
|
-
export declare class SitemapDependencies {
|
|
5
|
-
readonly dependencies: IScholarshipSitemapDependencies;
|
|
6
|
-
constructor();
|
|
7
|
-
get searchApiClient(): ISearchApiClient;
|
|
8
|
-
get organisationsClient(): IOrganisationsClient;
|
|
9
|
-
get dependencyType(): DependencyTypes;
|
|
10
|
-
setOrganisations(organisations: IOrganisation[]): void;
|
|
11
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { DependencyTypes } from '@/enums/DependencyTypes';
|
|
2
|
-
import { vi } from 'vitest';
|
|
3
|
-
export class SitemapDependencies {
|
|
4
|
-
dependencies;
|
|
5
|
-
constructor() {
|
|
6
|
-
const searchApiClient = {
|
|
7
|
-
getOrganisationIds: vi.fn(),
|
|
8
|
-
getCount: vi.fn()
|
|
9
|
-
};
|
|
10
|
-
const organisationsClient = {
|
|
11
|
-
getOrganisations: vi.fn()
|
|
12
|
-
};
|
|
13
|
-
const dependencyType = DependencyTypes.SITEMAP_GENERATOR;
|
|
14
|
-
this.dependencies = {
|
|
15
|
-
searchApiClient,
|
|
16
|
-
organisationsClient,
|
|
17
|
-
dependencyType
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
get searchApiClient() {
|
|
21
|
-
return this.dependencies.searchApiClient;
|
|
22
|
-
}
|
|
23
|
-
get organisationsClient() {
|
|
24
|
-
return this.dependencies.organisationsClient;
|
|
25
|
-
}
|
|
26
|
-
get dependencyType() {
|
|
27
|
-
return this.dependencies.dependencyType;
|
|
28
|
-
}
|
|
29
|
-
setOrganisations(organisations) {
|
|
30
|
-
this.dependencies.searchApiClient.getOrganisationIds.mockResolvedValue(organisations.map((org) => org.id));
|
|
31
|
-
this.dependencies.organisationsClient.getOrganisations.mockResolvedValue(organisations);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect, vi, beforeEach } from 'vitest';
|
|
2
|
-
import { BaseSitemapUrlGeneratorManager } from '@/sitemap-generator/BaseSitemapUrlGeneratorManager';
|
|
3
|
-
import { FilterCombinations } from '@/enums/FilterCombinations';
|
|
4
|
-
import { FilterKey } from '@studyportals/search-filters/server-side';
|
|
5
|
-
// Create a concrete implementation of the abstract class for testing
|
|
6
|
-
class TestSitemapUrlGeneratorManager extends BaseSitemapUrlGeneratorManager {
|
|
7
|
-
policies;
|
|
8
|
-
presenters = new Map();
|
|
9
|
-
constructor(policies = []) {
|
|
10
|
-
super();
|
|
11
|
-
this.policies = policies;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
describe('BaseSitemapUrlGeneratorManager', () => {
|
|
15
|
-
let mockPolicy1;
|
|
16
|
-
let mockPolicy2;
|
|
17
|
-
let manager;
|
|
18
|
-
beforeEach(() => {
|
|
19
|
-
// Create mock policies
|
|
20
|
-
mockPolicy1 = {
|
|
21
|
-
filterCombination: FilterCombinations.UNFILTERED,
|
|
22
|
-
generateSitemapUrls: vi.fn().mockResolvedValue(['url1', 'url2']),
|
|
23
|
-
getAllRules: vi.fn().mockReturnValue([])
|
|
24
|
-
};
|
|
25
|
-
mockPolicy2 = {
|
|
26
|
-
filterCombination: FilterCombinations.COUNTRY,
|
|
27
|
-
generateSitemapUrls: vi.fn().mockResolvedValue(['url3', 'url4', 'url5']),
|
|
28
|
-
getAllRules: vi.fn().mockReturnValue([])
|
|
29
|
-
};
|
|
30
|
-
// Create manager with mock policies
|
|
31
|
-
manager = new TestSitemapUrlGeneratorManager([mockPolicy1, mockPolicy2]);
|
|
32
|
-
});
|
|
33
|
-
it('Should generate URLs for all policies', async () => {
|
|
34
|
-
const urlMap = await manager.generateUrls();
|
|
35
|
-
// Should call generateSitemapUrls on each policy
|
|
36
|
-
expect(mockPolicy1.generateSitemapUrls).toHaveBeenCalledTimes(1);
|
|
37
|
-
expect(mockPolicy2.generateSitemapUrls).toHaveBeenCalledTimes(1);
|
|
38
|
-
// Should return a map with the correct URLs for each policy
|
|
39
|
-
expect(urlMap.size).toBe(2);
|
|
40
|
-
expect(urlMap.get(FilterCombinations.UNFILTERED)).toEqual(['url1', 'url2']);
|
|
41
|
-
expect(urlMap.get(FilterCombinations.COUNTRY)).toEqual(['url3', 'url4', 'url5']);
|
|
42
|
-
});
|
|
43
|
-
it('Should return empty results if no policies are defined', async () => {
|
|
44
|
-
const emptyManager = new TestSitemapUrlGeneratorManager([]);
|
|
45
|
-
const urlMap = await emptyManager.generateUrls();
|
|
46
|
-
expect(urlMap.size).toBe(0);
|
|
47
|
-
});
|
|
48
|
-
it('Should get filter key value counts', () => {
|
|
49
|
-
const counts = manager.getFilterKeyValueCounts();
|
|
50
|
-
// Initially should be empty as setFilterKeyValueCounts hasn't been called
|
|
51
|
-
expect(counts.size).toBe(0);
|
|
52
|
-
});
|
|
53
|
-
it('Should set filter key value counts from presenters', () => {
|
|
54
|
-
// Create mock presenters
|
|
55
|
-
const mockPresenter1 = {
|
|
56
|
-
filterKey: FilterKey.COUNTRY,
|
|
57
|
-
getFragments: vi.fn().mockReturnValue([
|
|
58
|
-
{ id: '1', path: 'path1' },
|
|
59
|
-
{ id: '2', path: 'path2' }
|
|
60
|
-
])
|
|
61
|
-
};
|
|
62
|
-
const mockPresenter2 = {
|
|
63
|
-
filterKey: FilterKey.DISCIPLINES,
|
|
64
|
-
getFragments: vi.fn().mockReturnValue([{ id: '3', path: 'path3' }])
|
|
65
|
-
};
|
|
66
|
-
// Add presenters to the manager
|
|
67
|
-
manager.presenters.set(FilterKey.COUNTRY, mockPresenter1);
|
|
68
|
-
manager.presenters.set(FilterKey.DISCIPLINES, mockPresenter2);
|
|
69
|
-
// Call the protected method via casting
|
|
70
|
-
manager.setFilterKeyValueCounts();
|
|
71
|
-
// Check that counts were set correctly
|
|
72
|
-
const counts = manager.getFilterKeyValueCounts();
|
|
73
|
-
expect(counts.size).toBe(2);
|
|
74
|
-
expect(counts.get(FilterKey.COUNTRY)).toBe(2);
|
|
75
|
-
expect(counts.get(FilterKey.DISCIPLINES)).toBe(1);
|
|
76
|
-
});
|
|
77
|
-
it('Should return the policies', () => {
|
|
78
|
-
const policies = manager.getPolicies();
|
|
79
|
-
expect(policies).toBe(manager.policies);
|
|
80
|
-
expect(policies).toEqual([mockPolicy1, mockPolicy2]);
|
|
81
|
-
});
|
|
82
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect, vi, beforeEach } from 'vitest';
|
|
2
|
-
import { OrganisationsSitemapUrlGeneratorManager } from '@/sitemap-generator/OrganisationsSitemapUrlGeneratorManager';
|
|
3
|
-
import { PortalType } from '@studyportals/domain-client';
|
|
4
|
-
import { FilterKey } from '@studyportals/search-filters/server-side';
|
|
5
|
-
describe('OrganisationsSitemapUrlGeneratorManager', () => {
|
|
6
|
-
let searchApiClient;
|
|
7
|
-
let organisationsClient;
|
|
8
|
-
let rankingApiClient;
|
|
9
|
-
let manager;
|
|
10
|
-
beforeEach(() => {
|
|
11
|
-
// Create mock dependencies
|
|
12
|
-
searchApiClient = {
|
|
13
|
-
getOrganisationIds: vi.fn(),
|
|
14
|
-
getCount: vi.fn()
|
|
15
|
-
};
|
|
16
|
-
organisationsClient = {
|
|
17
|
-
getOrganisations: vi.fn()
|
|
18
|
-
};
|
|
19
|
-
rankingApiClient = {
|
|
20
|
-
getRankedOrganisationCount: vi.fn()
|
|
21
|
-
};
|
|
22
|
-
// Create the manager
|
|
23
|
-
manager = new OrganisationsSitemapUrlGeneratorManager(PortalType.MASTER, searchApiClient, organisationsClient, rankingApiClient);
|
|
24
|
-
});
|
|
25
|
-
it('Should initialize with all policies', () => {
|
|
26
|
-
// The manager should have initialized with all the policy classes
|
|
27
|
-
expect(manager.policies.length).toBeGreaterThan(0);
|
|
28
|
-
// Check a few specific policy types to ensure they're included
|
|
29
|
-
const policyClassNames = manager.policies.map((p) => p.constructor.name);
|
|
30
|
-
// Core policies that should be included
|
|
31
|
-
expect(policyClassNames).toContain('Area');
|
|
32
|
-
expect(policyClassNames).toContain('Attendance');
|
|
33
|
-
expect(policyClassNames).toContain('Country');
|
|
34
|
-
expect(policyClassNames).toContain('Unfiltered');
|
|
35
|
-
// Some ranked policies
|
|
36
|
-
expect(policyClassNames).toContain('RankedCountry');
|
|
37
|
-
expect(policyClassNames).toContain('RankedDiscipline');
|
|
38
|
-
expect(policyClassNames).toContain('RankedUnfiltered');
|
|
39
|
-
});
|
|
40
|
-
it('Should initialize with all presenters', () => {
|
|
41
|
-
// The manager should have all required presenters
|
|
42
|
-
expect(manager.presenters.size).toBeGreaterThan(0);
|
|
43
|
-
// Check that all expected filter keys have presenters
|
|
44
|
-
const expectedFilterKeys = [FilterKey.AREA, FilterKey.DELIVERY_METHOD, FilterKey.CONTINENT, FilterKey.COUNTRY, FilterKey.DISCIPLINES];
|
|
45
|
-
expectedFilterKeys.forEach((filterKey) => {
|
|
46
|
-
expect(manager.presenters.has(filterKey)).toBe(true);
|
|
47
|
-
expect(manager.presenters.get(filterKey)).toBeDefined();
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
|
-
it('Should use singleton presenters', () => {
|
|
51
|
-
// Get some presenters from the manager
|
|
52
|
-
const areaPresenter = manager.presenters.get(FilterKey.AREA);
|
|
53
|
-
const countryPresenter = manager.presenters.get(FilterKey.COUNTRY);
|
|
54
|
-
// Create a new manager
|
|
55
|
-
const newManager = new OrganisationsSitemapUrlGeneratorManager(PortalType.PHD, searchApiClient, organisationsClient, rankingApiClient);
|
|
56
|
-
// The presenters should be the same instances (singletons)
|
|
57
|
-
expect(newManager.presenters.get(FilterKey.AREA)).toBe(areaPresenter);
|
|
58
|
-
expect(newManager.presenters.get(FilterKey.COUNTRY)).toBe(countryPresenter);
|
|
59
|
-
});
|
|
60
|
-
it('Should set filter key value counts during initialization', () => {
|
|
61
|
-
// The manager should have filter key value counts set
|
|
62
|
-
const counts = manager.getFilterKeyValueCounts();
|
|
63
|
-
// There should be counts for all presenter filter keys
|
|
64
|
-
expect(counts.size).toBeGreaterThan(0);
|
|
65
|
-
expect(counts.size).toBe(manager.presenters.size);
|
|
66
|
-
// All counts should be numbers greater than or equal to 0
|
|
67
|
-
Array.from(counts.values()).forEach((count) => {
|
|
68
|
-
expect(typeof count).toBe('number');
|
|
69
|
-
expect(count).toBeGreaterThanOrEqual(0);
|
|
70
|
-
});
|
|
71
|
-
});
|
|
72
|
-
it('Should pass the correct portal type to policies', () => {
|
|
73
|
-
// The portal type should be passed to all policies
|
|
74
|
-
expect(manager.portalType).toBe(PortalType.MASTER);
|
|
75
|
-
// Change portal type and check that it's reflected
|
|
76
|
-
const phdManager = new OrganisationsSitemapUrlGeneratorManager(PortalType.PHD, searchApiClient, organisationsClient, rankingApiClient);
|
|
77
|
-
expect(phdManager.portalType).toBe(PortalType.PHD);
|
|
78
|
-
});
|
|
79
|
-
it('Should inherit from BaseSitemapUrlGeneratorManager', () => {
|
|
80
|
-
// Verify it extends the base class by checking for inherited methods
|
|
81
|
-
expect(manager.generateUrls).toBeDefined();
|
|
82
|
-
expect(manager.getFilterKeyValueCounts).toBeDefined();
|
|
83
|
-
expect(manager.getPolicies).toBeDefined();
|
|
84
|
-
});
|
|
85
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect, vi, beforeEach } from 'vitest';
|
|
2
|
-
import { ProgrammesSitemapUrlGeneratorManager } from '@/sitemap-generator/ProgrammesSitemapUrlGeneratorManager';
|
|
3
|
-
import { PortalType } from '@studyportals/domain-client';
|
|
4
|
-
import { FilterKey } from '@studyportals/search-filters/server-side';
|
|
5
|
-
describe('ProgrammesSitemapUrlGeneratorManager', () => {
|
|
6
|
-
let searchApiClient;
|
|
7
|
-
let manager;
|
|
8
|
-
beforeEach(() => {
|
|
9
|
-
// Create mock dependencies
|
|
10
|
-
searchApiClient = {
|
|
11
|
-
getOrganisationIds: vi.fn(),
|
|
12
|
-
getCount: vi.fn()
|
|
13
|
-
};
|
|
14
|
-
// Create the manager
|
|
15
|
-
manager = new ProgrammesSitemapUrlGeneratorManager(PortalType.MASTER, searchApiClient);
|
|
16
|
-
});
|
|
17
|
-
// it('Should initialize with all policies', () => {
|
|
18
|
-
// // The manager should have initialized with all the policy classes
|
|
19
|
-
// expect(manager.policies.length).toBeGreaterThan(0);
|
|
20
|
-
// // Check a few specific policy types to ensure they're included
|
|
21
|
-
// const policyClassNames = manager.policies.map((p) => p.constructor.name);
|
|
22
|
-
// // Core policies that should be included
|
|
23
|
-
// expect(policyClassNames).toContain('Area');
|
|
24
|
-
// expect(policyClassNames).toContain('Attendance');
|
|
25
|
-
// expect(policyClassNames).toContain('Country');
|
|
26
|
-
// expect(policyClassNames).toContain('Discipline');
|
|
27
|
-
// expect(policyClassNames).toContain('Unfiltered');
|
|
28
|
-
// // Some combined policies
|
|
29
|
-
// expect(policyClassNames).toContain('CountryAttendance');
|
|
30
|
-
// expect(policyClassNames).toContain('DisciplineCountry');
|
|
31
|
-
// });
|
|
32
|
-
it('Should initialize with all presenters', () => {
|
|
33
|
-
// The manager should have all required presenters
|
|
34
|
-
expect(manager.presenters.size).toBeGreaterThan(0);
|
|
35
|
-
// Check that all expected filter keys have presenters
|
|
36
|
-
const expectedFilterKeys = [
|
|
37
|
-
FilterKey.AREA,
|
|
38
|
-
FilterKey.DELIVERY_METHOD,
|
|
39
|
-
FilterKey.DEGREE_TYPE,
|
|
40
|
-
FilterKey.CONTINENT,
|
|
41
|
-
FilterKey.TUITION_FEE,
|
|
42
|
-
FilterKey.COUNTRY,
|
|
43
|
-
FilterKey.DISCIPLINES,
|
|
44
|
-
FilterKey.SPECIAL_PROGRAMMES,
|
|
45
|
-
FilterKey.DURATION,
|
|
46
|
-
FilterKey.EDUCATIONAL_FORM,
|
|
47
|
-
FilterKey.ATTENDANCE
|
|
48
|
-
];
|
|
49
|
-
expectedFilterKeys.forEach((filterKey) => {
|
|
50
|
-
expect(manager.presenters.has(filterKey)).toBe(true);
|
|
51
|
-
expect(manager.presenters.get(filterKey)).toBeDefined();
|
|
52
|
-
});
|
|
53
|
-
});
|
|
54
|
-
it('Should use singleton presenters', () => {
|
|
55
|
-
// Get some presenters from the manager
|
|
56
|
-
const areaPresenter = manager.presenters.get(FilterKey.AREA);
|
|
57
|
-
const countryPresenter = manager.presenters.get(FilterKey.COUNTRY);
|
|
58
|
-
// Create a new manager
|
|
59
|
-
const newManager = new ProgrammesSitemapUrlGeneratorManager(PortalType.PHD, searchApiClient);
|
|
60
|
-
// The presenters should be the same instances (singletons)
|
|
61
|
-
expect(newManager.presenters.get(FilterKey.AREA)).toBe(areaPresenter);
|
|
62
|
-
expect(newManager.presenters.get(FilterKey.COUNTRY)).toBe(countryPresenter);
|
|
63
|
-
});
|
|
64
|
-
it('Should pass the correct portal type to policies', () => {
|
|
65
|
-
// The portal type should be passed to all policies
|
|
66
|
-
expect(manager.portalType).toBe(PortalType.MASTER);
|
|
67
|
-
// Change portal type and check that it's reflected
|
|
68
|
-
const phdManager = new ProgrammesSitemapUrlGeneratorManager(PortalType.PHD, searchApiClient);
|
|
69
|
-
expect(phdManager.portalType).toBe(PortalType.PHD);
|
|
70
|
-
});
|
|
71
|
-
it('Should inherit from BaseSitemapUrlGeneratorManager', () => {
|
|
72
|
-
// Verify it extends the base class by checking for inherited methods
|
|
73
|
-
expect(manager.generateUrls).toBeDefined();
|
|
74
|
-
expect(manager.getFilterKeyValueCounts).toBeDefined();
|
|
75
|
-
expect(manager.getPolicies).toBeDefined();
|
|
76
|
-
});
|
|
77
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect, vi, beforeEach } from 'vitest';
|
|
2
|
-
import { ScholarshipsSitemapUrlGeneratorManager } from '@/sitemap-generator/ScholarshipsSitemapUrlGeneratorManager';
|
|
3
|
-
describe('ScholarshipsSitemapUrlGeneratorManager', () => {
|
|
4
|
-
let searchApiClient;
|
|
5
|
-
let organisationsClient;
|
|
6
|
-
let manager;
|
|
7
|
-
beforeEach(() => {
|
|
8
|
-
// Create mock dependencies
|
|
9
|
-
searchApiClient = {
|
|
10
|
-
getOrganisationIds: vi.fn(),
|
|
11
|
-
getCount: vi.fn()
|
|
12
|
-
};
|
|
13
|
-
organisationsClient = {
|
|
14
|
-
getOrganisations: vi.fn()
|
|
15
|
-
};
|
|
16
|
-
// Create the manager
|
|
17
|
-
manager = new ScholarshipsSitemapUrlGeneratorManager(searchApiClient, organisationsClient);
|
|
18
|
-
});
|
|
19
|
-
it('Should initialize with all policies', () => {
|
|
20
|
-
// The manager should have initialized with all the policy classes
|
|
21
|
-
expect(manager.policies.length).toBeGreaterThan(0);
|
|
22
|
-
// Check a few specific policy types to ensure they're included
|
|
23
|
-
const policyClassNames = manager.policies.map((p) => p.constructor.name);
|
|
24
|
-
// Core policies that should be included
|
|
25
|
-
expect(policyClassNames).toContain('Area');
|
|
26
|
-
expect(policyClassNames).toContain('Country');
|
|
27
|
-
expect(policyClassNames).toContain('Discipline');
|
|
28
|
-
expect(policyClassNames).toContain('Unfiltered');
|
|
29
|
-
// Some combined policies
|
|
30
|
-
expect(policyClassNames).toContain('DisciplineCountry');
|
|
31
|
-
expect(policyClassNames).toContain('UniversityCountry');
|
|
32
|
-
});
|
|
33
|
-
it('Should have empty presenters map', () => {
|
|
34
|
-
// The ScholarshipsSitemapUrlGeneratorManager doesn't initialize any presenters
|
|
35
|
-
expect(manager.presenters.size).toBe(0);
|
|
36
|
-
});
|
|
37
|
-
it('Should inherit from BaseSitemapUrlGeneratorManager', () => {
|
|
38
|
-
// Verify it extends the base class by checking for inherited methods
|
|
39
|
-
expect(manager.generateUrls).toBeDefined();
|
|
40
|
-
expect(manager.getFilterKeyValueCounts).toBeDefined();
|
|
41
|
-
expect(manager.getPolicies).toBeDefined();
|
|
42
|
-
});
|
|
43
|
-
it('Should pass dependencies to policies', async () => {
|
|
44
|
-
// Mock the generateSitemapUrls method of the first policy
|
|
45
|
-
const firstPolicy = manager.policies[0];
|
|
46
|
-
const originalGenerateSitemapUrls = firstPolicy.generateSitemapUrls;
|
|
47
|
-
firstPolicy.generateSitemapUrls = vi.fn().mockResolvedValue(['test-url']);
|
|
48
|
-
// Generate URLs
|
|
49
|
-
const urlMap = await manager.generateUrls();
|
|
50
|
-
// The policy's generateSitemapUrls should be called
|
|
51
|
-
expect(firstPolicy.generateSitemapUrls).toHaveBeenCalledTimes(1);
|
|
52
|
-
// Restore the original method
|
|
53
|
-
firstPolicy.generateSitemapUrls = originalGenerateSitemapUrls;
|
|
54
|
-
});
|
|
55
|
-
it('Should not call setFilterKeyValueCounts since presenters are empty', () => {
|
|
56
|
-
// The filter key value counts should be empty
|
|
57
|
-
const counts = manager.getFilterKeyValueCounts();
|
|
58
|
-
expect(counts.size).toBe(0);
|
|
59
|
-
});
|
|
60
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|