@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,105 @@
|
|
|
1
|
+
import { describe, it, expect, beforeEach, vi } from 'vitest';
|
|
2
|
+
import { FilterKey } from '@studyportals/search-filters/server-side';
|
|
3
|
+
import { Continent } from '@/organisations/policies/our-picks/Continent';
|
|
4
|
+
import { SearchDependencies } from '../../../organisations/utils/SearchDependencies.util.mjs';
|
|
5
|
+
import { SitemapDependencies } from '../../utils/SitemapDependencies.util.mjs';
|
|
6
|
+
import { SortingOptions } from '@/enums/SortingOptions';
|
|
7
|
+
import { ContinentPresenter } from '@/presenters/ContinentPresenter';
|
|
8
|
+
import { PortalType } from '@studyportals/domain-client';
|
|
9
|
+
describe('Policy:Continent', () => {
|
|
10
|
+
describe('shouldIndex', () => {
|
|
11
|
+
let searchDependenciesHelper;
|
|
12
|
+
let continentPolicy;
|
|
13
|
+
beforeEach(() => {
|
|
14
|
+
searchDependenciesHelper = new SearchDependencies();
|
|
15
|
+
continentPolicy = new Continent(searchDependenciesHelper.dependencies);
|
|
16
|
+
searchDependenciesHelper.setSortingState(SortingOptions.OUR_PICKS);
|
|
17
|
+
searchDependenciesHelper.setNumberOfResults(10);
|
|
18
|
+
});
|
|
19
|
+
it('Should return true when all conditions are met', async () => {
|
|
20
|
+
const continentId = '1'; // Europe
|
|
21
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([[FilterKey.CONTINENT, [continentId]]]));
|
|
22
|
+
const result = await continentPolicy.shouldIndex();
|
|
23
|
+
expect(result).toBe(true);
|
|
24
|
+
});
|
|
25
|
+
it.each([[PortalType.BACHELOR], [PortalType.PHD], [PortalType.SHORT]])('Should return false when the selected portal type is %s', async (portalType) => {
|
|
26
|
+
const continentId = '1'; // Europe
|
|
27
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([[FilterKey.CONTINENT, [continentId]]]));
|
|
28
|
+
searchDependenciesHelper.setPortalType(portalType);
|
|
29
|
+
const result = await continentPolicy.shouldIndex();
|
|
30
|
+
expect(result).toBe(false);
|
|
31
|
+
});
|
|
32
|
+
it('Should return false when area when University Meta Ranking sorting is selected', async () => {
|
|
33
|
+
const continentId = '1'; // Europe
|
|
34
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([[FilterKey.CONTINENT, [continentId]]]));
|
|
35
|
+
searchDependenciesHelper.setSortingState(SortingOptions.UNIVERSITY_META_RANKING);
|
|
36
|
+
const result = await continentPolicy.shouldIndex();
|
|
37
|
+
expect(result).toBe(false);
|
|
38
|
+
});
|
|
39
|
+
it('Should return false when multiple continents are selected', async () => {
|
|
40
|
+
const firstContinentId = '1'; // Europe
|
|
41
|
+
const secondContinentId = '9'; // Asia
|
|
42
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([[FilterKey.CONTINENT, [firstContinentId, secondContinentId]]]));
|
|
43
|
+
const result = await continentPolicy.shouldIndex();
|
|
44
|
+
expect(result).toBe(false);
|
|
45
|
+
});
|
|
46
|
+
it('Should return false when no continents are selected', async () => {
|
|
47
|
+
const countryId = '30'; // UK
|
|
48
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([[FilterKey.COUNTRY, [countryId]]]));
|
|
49
|
+
const result = await continentPolicy.shouldIndex();
|
|
50
|
+
expect(result).toBe(false);
|
|
51
|
+
});
|
|
52
|
+
it('Should return false when other filters are selected', async () => {
|
|
53
|
+
const continentId = '1'; // Europe
|
|
54
|
+
const areaId = '996'; // England
|
|
55
|
+
const countryId = '30'; // UK
|
|
56
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([
|
|
57
|
+
[FilterKey.AREA, [areaId]],
|
|
58
|
+
[FilterKey.COUNTRY, [countryId]],
|
|
59
|
+
[FilterKey.CONTINENT, [continentId]]
|
|
60
|
+
]));
|
|
61
|
+
const result = await continentPolicy.shouldIndex();
|
|
62
|
+
expect(result).toBe(false);
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
describe('generateSitemapUrls', () => {
|
|
66
|
+
let sitemapDependenciesHelper;
|
|
67
|
+
let continentPolicy;
|
|
68
|
+
let continentFragments;
|
|
69
|
+
beforeEach(() => {
|
|
70
|
+
sitemapDependenciesHelper = new SitemapDependencies();
|
|
71
|
+
sitemapDependenciesHelper.setOrganisationCount(10);
|
|
72
|
+
continentPolicy = new Continent(sitemapDependenciesHelper.dependencies);
|
|
73
|
+
vi.spyOn(ContinentPresenter, 'getInstance').mockReturnValue({
|
|
74
|
+
getFragments: vi.fn(() => continentFragments),
|
|
75
|
+
generatePaths: vi.fn(() => continentFragments),
|
|
76
|
+
fragments: continentFragments
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
it('Should return path when all conditions are met', async () => {
|
|
80
|
+
const continentId = '1'; // Europe
|
|
81
|
+
const continentPath = 'path';
|
|
82
|
+
continentFragments = [
|
|
83
|
+
{
|
|
84
|
+
id: continentId,
|
|
85
|
+
path: continentPath
|
|
86
|
+
}
|
|
87
|
+
];
|
|
88
|
+
const result = await continentPolicy.generateSitemapUrls();
|
|
89
|
+
expect(result).toEqual([`${continentPath}`]);
|
|
90
|
+
});
|
|
91
|
+
it.each([[PortalType.BACHELOR], [PortalType.PHD], [PortalType.SHORT]])('Should not return path when portal type is %s', async (portalType) => {
|
|
92
|
+
const continentId = '1'; // Europe
|
|
93
|
+
const continentPath = 'path';
|
|
94
|
+
continentFragments = [
|
|
95
|
+
{
|
|
96
|
+
id: continentId,
|
|
97
|
+
path: continentPath
|
|
98
|
+
}
|
|
99
|
+
];
|
|
100
|
+
sitemapDependenciesHelper.setPortalType(portalType);
|
|
101
|
+
const result = await continentPolicy.generateSitemapUrls();
|
|
102
|
+
expect(result).toEqual([]);
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { describe, it, expect, beforeEach, vi } from 'vitest';
|
|
2
|
+
import { FilterKey } from '@studyportals/search-filters/server-side';
|
|
3
|
+
import { Country } from '@/organisations/policies/our-picks/Country';
|
|
4
|
+
import { SearchDependencies } from '../../../organisations/utils/SearchDependencies.util.mjs';
|
|
5
|
+
import { SitemapDependencies } from '../../utils/SitemapDependencies.util.mjs';
|
|
6
|
+
import { SortingOptions } from '@/enums/SortingOptions';
|
|
7
|
+
import { PortalType } from '@studyportals/domain-client';
|
|
8
|
+
import { CountryPresenter } from '@/presenters/CountryPresenter';
|
|
9
|
+
describe('Policy:Country', () => {
|
|
10
|
+
describe('shouldIndex', () => {
|
|
11
|
+
let searchDependenciesHelper;
|
|
12
|
+
let countryPolicy;
|
|
13
|
+
beforeEach(() => {
|
|
14
|
+
searchDependenciesHelper = new SearchDependencies();
|
|
15
|
+
countryPolicy = new Country(searchDependenciesHelper.dependencies);
|
|
16
|
+
searchDependenciesHelper.setSortingState(SortingOptions.OUR_PICKS);
|
|
17
|
+
searchDependenciesHelper.setNumberOfResults(10);
|
|
18
|
+
});
|
|
19
|
+
it('Should return true when all conditions are met', async () => {
|
|
20
|
+
const countryId = '30'; // UK
|
|
21
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([[FilterKey.COUNTRY, [countryId]]]));
|
|
22
|
+
const result = await countryPolicy.shouldIndex();
|
|
23
|
+
expect(result).toBe(true);
|
|
24
|
+
});
|
|
25
|
+
it.each([[PortalType.BACHELOR], [PortalType.PHD], [PortalType.SHORT]])('Should return false when the selected portal type is %s', async (portalType) => {
|
|
26
|
+
const countryId = '30'; // UK
|
|
27
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([[FilterKey.COUNTRY, [countryId]]]));
|
|
28
|
+
searchDependenciesHelper.setPortalType(portalType);
|
|
29
|
+
const result = await countryPolicy.shouldIndex();
|
|
30
|
+
expect(result).toBe(false);
|
|
31
|
+
});
|
|
32
|
+
it('Should return false when area when University Meta Ranking sorting is selected', async () => {
|
|
33
|
+
const countryId = '30'; // UK
|
|
34
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([[FilterKey.COUNTRY, [countryId]]]));
|
|
35
|
+
searchDependenciesHelper.setSortingState(SortingOptions.UNIVERSITY_META_RANKING);
|
|
36
|
+
const result = await countryPolicy.shouldIndex();
|
|
37
|
+
expect(result).toBe(false);
|
|
38
|
+
});
|
|
39
|
+
it('Should return false when multiple countries are selected', async () => {
|
|
40
|
+
const firstCountryId = '30'; // UK
|
|
41
|
+
const secondCountryId = '82'; // US
|
|
42
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([[FilterKey.COUNTRY, [firstCountryId, secondCountryId]]]));
|
|
43
|
+
const result = await countryPolicy.shouldIndex();
|
|
44
|
+
expect(result).toBe(false);
|
|
45
|
+
});
|
|
46
|
+
it('Should return false when no countries are selected', async () => {
|
|
47
|
+
const areaId = '137'; // Western Australia
|
|
48
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([[FilterKey.AREA, [areaId]]]));
|
|
49
|
+
const result = await countryPolicy.shouldIndex();
|
|
50
|
+
expect(result).toBe(false);
|
|
51
|
+
});
|
|
52
|
+
it('Should return false when other filters are selected', async () => {
|
|
53
|
+
const continentId = '1'; // Europe
|
|
54
|
+
const areaId = '996'; // England
|
|
55
|
+
const countryId = '30'; // UK
|
|
56
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([
|
|
57
|
+
[FilterKey.AREA, [areaId]],
|
|
58
|
+
[FilterKey.COUNTRY, [countryId]],
|
|
59
|
+
[FilterKey.CONTINENT, [continentId]]
|
|
60
|
+
]));
|
|
61
|
+
const result = await countryPolicy.shouldIndex();
|
|
62
|
+
expect(result).toBe(false);
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
describe('generateSitemapUrls', () => {
|
|
66
|
+
let sitemapDependenciesHelper;
|
|
67
|
+
let countryPolicy;
|
|
68
|
+
let countryFragments;
|
|
69
|
+
beforeEach(() => {
|
|
70
|
+
sitemapDependenciesHelper = new SitemapDependencies();
|
|
71
|
+
sitemapDependenciesHelper.setOrganisationCount(10);
|
|
72
|
+
countryPolicy = new Country(sitemapDependenciesHelper.dependencies);
|
|
73
|
+
vi.spyOn(CountryPresenter, 'getInstance').mockReturnValue({
|
|
74
|
+
getFragments: vi.fn(() => countryFragments),
|
|
75
|
+
generatePaths: vi.fn(() => countryFragments),
|
|
76
|
+
fragments: countryFragments
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
it('Should return path when all conditions are met', async () => {
|
|
80
|
+
const countryId = '30'; // UK
|
|
81
|
+
const countryIso = 'GB';
|
|
82
|
+
const countryPath = 'path';
|
|
83
|
+
countryFragments = [
|
|
84
|
+
{
|
|
85
|
+
id: countryId,
|
|
86
|
+
iso: countryIso,
|
|
87
|
+
path: countryPath
|
|
88
|
+
}
|
|
89
|
+
];
|
|
90
|
+
const result = await countryPolicy.generateSitemapUrls();
|
|
91
|
+
expect(result).toEqual([`${countryPath}`]);
|
|
92
|
+
});
|
|
93
|
+
it.each([[PortalType.BACHELOR], [PortalType.PHD], [PortalType.SHORT]])('Should not return path when portal type is %s', async (portalType) => {
|
|
94
|
+
const countryId = '30'; // UK
|
|
95
|
+
const countryIso = 'GB';
|
|
96
|
+
const countryPath = 'path';
|
|
97
|
+
countryFragments = [
|
|
98
|
+
{
|
|
99
|
+
id: countryId,
|
|
100
|
+
iso: countryIso,
|
|
101
|
+
path: countryPath
|
|
102
|
+
}
|
|
103
|
+
];
|
|
104
|
+
sitemapDependenciesHelper.setPortalType(portalType);
|
|
105
|
+
const result = await countryPolicy.generateSitemapUrls();
|
|
106
|
+
expect(result).toEqual([]);
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { SortingOptions } from "@/enums/SortingOptions";
|
|
2
|
+
import { CountryAreaCity } from "@/organisations/policies";
|
|
3
|
+
import { FilterKey } from "@studyportals/search-filters/server-side";
|
|
4
|
+
import { SearchDependencies } from '../../../organisations/utils/SearchDependencies.util.mjs';
|
|
5
|
+
import { beforeEach, describe, expect, it, vi } from "vitest";
|
|
6
|
+
import { CityPresenter } from "@/presenters/CityPresenter";
|
|
7
|
+
import { PortalType } from "@studyportals/domain-client";
|
|
8
|
+
import { SitemapDependencies } from '../../utils/SitemapDependencies.util.mjs';
|
|
9
|
+
describe('Policy:CountryAreaCity', () => {
|
|
10
|
+
describe('shouldIndex', () => {
|
|
11
|
+
let searchDependenciesHelper;
|
|
12
|
+
let countryAreaCityPolicy;
|
|
13
|
+
beforeEach(() => {
|
|
14
|
+
searchDependenciesHelper = new SearchDependencies();
|
|
15
|
+
countryAreaCityPolicy = new CountryAreaCity(searchDependenciesHelper.dependencies);
|
|
16
|
+
searchDependenciesHelper.setSortingState(SortingOptions.OUR_PICKS);
|
|
17
|
+
searchDependenciesHelper.setNumberOfResults(10);
|
|
18
|
+
});
|
|
19
|
+
it('Should return true when all conditions are met', async () => {
|
|
20
|
+
const cityID = '';
|
|
21
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([
|
|
22
|
+
[FilterKey.COUNTRY, ['30']],
|
|
23
|
+
[FilterKey.AREA, ['8']],
|
|
24
|
+
[FilterKey.CITY, ['1']]
|
|
25
|
+
]));
|
|
26
|
+
const result = await countryAreaCityPolicy.shouldIndex();
|
|
27
|
+
expect(result).toBe(true);
|
|
28
|
+
});
|
|
29
|
+
it('Should return false when area is missing', async () => {
|
|
30
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([
|
|
31
|
+
[FilterKey.COUNTRY, ['30']],
|
|
32
|
+
[FilterKey.CITY, ['1']]
|
|
33
|
+
]));
|
|
34
|
+
const result = await countryAreaCityPolicy.shouldIndex();
|
|
35
|
+
expect(result).toBe(false);
|
|
36
|
+
});
|
|
37
|
+
it('Should return false when multiple areas are selected', async () => {
|
|
38
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([
|
|
39
|
+
[FilterKey.COUNTRY, ['30']],
|
|
40
|
+
[FilterKey.AREA, ['8', '9']],
|
|
41
|
+
[FilterKey.CITY, ['1']]
|
|
42
|
+
]));
|
|
43
|
+
const result = await countryAreaCityPolicy.shouldIndex();
|
|
44
|
+
expect(result).toBe(false);
|
|
45
|
+
});
|
|
46
|
+
it('Should return false when country is missing', async () => {
|
|
47
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([
|
|
48
|
+
[FilterKey.AREA, ['8']],
|
|
49
|
+
[FilterKey.CITY, ['1']]
|
|
50
|
+
]));
|
|
51
|
+
const result = await countryAreaCityPolicy.shouldIndex();
|
|
52
|
+
expect(result).toBe(false);
|
|
53
|
+
});
|
|
54
|
+
it('Should return false when multiple countries are selected', async () => {
|
|
55
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([
|
|
56
|
+
[FilterKey.COUNTRY, ['30', '82']],
|
|
57
|
+
[FilterKey.AREA, ['8']],
|
|
58
|
+
[FilterKey.CITY, ['1']]
|
|
59
|
+
]));
|
|
60
|
+
const result = await countryAreaCityPolicy.shouldIndex();
|
|
61
|
+
expect(result).toBe(false);
|
|
62
|
+
});
|
|
63
|
+
it('Should return false when city is missing', async () => {
|
|
64
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([
|
|
65
|
+
[FilterKey.COUNTRY, ['30']],
|
|
66
|
+
[FilterKey.AREA, ['8']]
|
|
67
|
+
]));
|
|
68
|
+
const result = await countryAreaCityPolicy.shouldIndex();
|
|
69
|
+
expect(result).toBe(false);
|
|
70
|
+
});
|
|
71
|
+
it('Should return false when multiple cities are selected', async () => {
|
|
72
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([
|
|
73
|
+
[FilterKey.COUNTRY, ['30']],
|
|
74
|
+
[FilterKey.AREA, ['8']],
|
|
75
|
+
[FilterKey.CITY, ['1', '2']]
|
|
76
|
+
]));
|
|
77
|
+
const result = await countryAreaCityPolicy.shouldIndex();
|
|
78
|
+
expect(result).toBe(false);
|
|
79
|
+
});
|
|
80
|
+
it('Should return false when other filters are selected', async () => {
|
|
81
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([
|
|
82
|
+
[FilterKey.COUNTRY, ['30']],
|
|
83
|
+
[FilterKey.AREA, ['8']],
|
|
84
|
+
[FilterKey.CITY, ['1']],
|
|
85
|
+
[FilterKey.CONTINENT, ['1']]
|
|
86
|
+
]));
|
|
87
|
+
const result = await countryAreaCityPolicy.shouldIndex();
|
|
88
|
+
expect(result).toBe(false);
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
describe('generateSitemapUrls', () => {
|
|
92
|
+
let sitemapDependenciesHelper;
|
|
93
|
+
let countryAreaCityPolicy;
|
|
94
|
+
let cityFragments;
|
|
95
|
+
beforeEach(() => {
|
|
96
|
+
sitemapDependenciesHelper = new SitemapDependencies();
|
|
97
|
+
sitemapDependenciesHelper.setOrganisationCount(10);
|
|
98
|
+
countryAreaCityPolicy = new CountryAreaCity(sitemapDependenciesHelper.dependencies);
|
|
99
|
+
vi.spyOn(CityPresenter, 'getInstance').mockReturnValue({
|
|
100
|
+
getFragments: vi.fn(() => cityFragments),
|
|
101
|
+
generatePaths: vi.fn(() => cityFragments),
|
|
102
|
+
fragments: cityFragments
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
it('Should generate correct sitemap urls', async () => {
|
|
106
|
+
const countryId = '30';
|
|
107
|
+
const areaId = '8';
|
|
108
|
+
const cityId = '1';
|
|
109
|
+
cityFragments = [
|
|
110
|
+
{
|
|
111
|
+
id: cityId,
|
|
112
|
+
areaId: areaId,
|
|
113
|
+
countryId: countryId,
|
|
114
|
+
path: '/uk/england/city'
|
|
115
|
+
}
|
|
116
|
+
];
|
|
117
|
+
const result = await countryAreaCityPolicy.generateSitemapUrls();
|
|
118
|
+
expect(result).toEqual(['/uk/england/city']);
|
|
119
|
+
});
|
|
120
|
+
it('Should not generate urls when areaId is empty string', async () => {
|
|
121
|
+
const countryId = '30';
|
|
122
|
+
const cityId = '1';
|
|
123
|
+
const areaId = '';
|
|
124
|
+
cityFragments = [
|
|
125
|
+
{
|
|
126
|
+
id: cityId,
|
|
127
|
+
areaId: areaId,
|
|
128
|
+
countryId: countryId,
|
|
129
|
+
path: '/uk/england/city'
|
|
130
|
+
}
|
|
131
|
+
];
|
|
132
|
+
const result = await countryAreaCityPolicy.generateSitemapUrls();
|
|
133
|
+
expect(result).toEqual([]);
|
|
134
|
+
});
|
|
135
|
+
it.each([[PortalType.BACHELOR], [PortalType.PHD], [PortalType.SHORT]])('Should not return path when portal type is %s', async (portalType) => {
|
|
136
|
+
const countryId = '30';
|
|
137
|
+
const areaId = '8';
|
|
138
|
+
const cityId = '1';
|
|
139
|
+
cityFragments = [
|
|
140
|
+
{
|
|
141
|
+
id: cityId,
|
|
142
|
+
areaId: areaId,
|
|
143
|
+
countryId: countryId,
|
|
144
|
+
path: '/uk/england/city'
|
|
145
|
+
}
|
|
146
|
+
];
|
|
147
|
+
sitemapDependenciesHelper.setPortalType(portalType);
|
|
148
|
+
const result = await countryAreaCityPolicy.generateSitemapUrls();
|
|
149
|
+
expect(result).toEqual([]);
|
|
150
|
+
});
|
|
151
|
+
});
|
|
152
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
import { describe, it, expect, beforeEach, vi } from 'vitest';
|
|
2
|
+
import { FilterKey } from '@studyportals/search-filters/server-side';
|
|
3
|
+
import { SearchDependencies } from '../../../organisations/utils/SearchDependencies.util.mjs';
|
|
4
|
+
import { SitemapDependencies } from '../../utils/SitemapDependencies.util.mjs';
|
|
5
|
+
import { SortingOptions } from '@/enums/SortingOptions';
|
|
6
|
+
import { CountryAttendance } from '@/organisations/policies';
|
|
7
|
+
import { PortalType } from '@studyportals/domain-client';
|
|
8
|
+
import { CountryPresenter } from '@/presenters/CountryPresenter';
|
|
9
|
+
import { AttendancePresenter } from '@/presenters/AttendancePresenter';
|
|
10
|
+
describe('Policy:CountryAttendance', () => {
|
|
11
|
+
describe('shouldIndex', () => {
|
|
12
|
+
let searchDependenciesHelper;
|
|
13
|
+
let countryAttendancePolicy;
|
|
14
|
+
beforeEach(() => {
|
|
15
|
+
searchDependenciesHelper = new SearchDependencies();
|
|
16
|
+
countryAttendancePolicy = new CountryAttendance(searchDependenciesHelper.dependencies);
|
|
17
|
+
searchDependenciesHelper.setSortingState(SortingOptions.OUR_PICKS);
|
|
18
|
+
searchDependenciesHelper.setNumberOfResults(10);
|
|
19
|
+
});
|
|
20
|
+
it('Should return true when all conditions are met', async () => {
|
|
21
|
+
const countryId = '82'; // US
|
|
22
|
+
const attendance = 'online';
|
|
23
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([
|
|
24
|
+
[FilterKey.COUNTRY, [countryId]],
|
|
25
|
+
[FilterKey.DELIVERY_METHOD, [attendance]]
|
|
26
|
+
]));
|
|
27
|
+
const result = await countryAttendancePolicy.shouldIndex();
|
|
28
|
+
expect(result).toBe(true);
|
|
29
|
+
});
|
|
30
|
+
it.each([[PortalType.BACHELOR], [PortalType.PHD], [PortalType.SHORT]])('Should return false when the selected portal type is %s', async (portalType) => {
|
|
31
|
+
const countryId = '82'; // US
|
|
32
|
+
const attendance = 'online';
|
|
33
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([
|
|
34
|
+
[FilterKey.COUNTRY, [countryId]],
|
|
35
|
+
[FilterKey.DELIVERY_METHOD, [attendance]]
|
|
36
|
+
]));
|
|
37
|
+
searchDependenciesHelper.setPortalType(portalType);
|
|
38
|
+
const result = await countryAttendancePolicy.shouldIndex();
|
|
39
|
+
expect(result).toBe(false);
|
|
40
|
+
});
|
|
41
|
+
it('Should return false when area when University Meta Ranking sorting is selected', async () => {
|
|
42
|
+
const countryId = '82'; // US
|
|
43
|
+
const attendance = 'online';
|
|
44
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([
|
|
45
|
+
[FilterKey.COUNTRY, [countryId]],
|
|
46
|
+
[FilterKey.DELIVERY_METHOD, [attendance]]
|
|
47
|
+
]));
|
|
48
|
+
searchDependenciesHelper.setSortingState(SortingOptions.UNIVERSITY_META_RANKING);
|
|
49
|
+
const result = await countryAttendancePolicy.shouldIndex();
|
|
50
|
+
expect(result).toBe(false);
|
|
51
|
+
});
|
|
52
|
+
it('Should return false when multiple countries are selected', async () => {
|
|
53
|
+
const firstCountryId = '30'; // UK
|
|
54
|
+
const secondCountryId = '82'; // US
|
|
55
|
+
const attendance = 'online';
|
|
56
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([
|
|
57
|
+
[FilterKey.COUNTRY, [firstCountryId, secondCountryId]],
|
|
58
|
+
[FilterKey.DELIVERY_METHOD, [attendance]]
|
|
59
|
+
]));
|
|
60
|
+
const result = await countryAttendancePolicy.shouldIndex();
|
|
61
|
+
expect(result).toBe(false);
|
|
62
|
+
});
|
|
63
|
+
it('Should return false when no countries are selected', async () => {
|
|
64
|
+
const attendance = 'online';
|
|
65
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([[FilterKey.DELIVERY_METHOD, [attendance]]]));
|
|
66
|
+
const result = await countryAttendancePolicy.shouldIndex();
|
|
67
|
+
expect(result).toBe(false);
|
|
68
|
+
});
|
|
69
|
+
it('Should return false when other filters are selected', async () => {
|
|
70
|
+
const areaId = '996'; // England
|
|
71
|
+
const countryId = '30'; // UK
|
|
72
|
+
const attendance = 'online';
|
|
73
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([
|
|
74
|
+
[FilterKey.AREA, [areaId]],
|
|
75
|
+
[FilterKey.COUNTRY, [countryId]],
|
|
76
|
+
[FilterKey.DELIVERY_METHOD, [attendance]]
|
|
77
|
+
]));
|
|
78
|
+
const result = await countryAttendancePolicy.shouldIndex();
|
|
79
|
+
expect(result).toBe(false);
|
|
80
|
+
});
|
|
81
|
+
it('Should return false when attendance is not online', async () => {
|
|
82
|
+
const countryId = '30'; // UK
|
|
83
|
+
const attendance = 'blended';
|
|
84
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([
|
|
85
|
+
[FilterKey.COUNTRY, [countryId]],
|
|
86
|
+
[FilterKey.DELIVERY_METHOD, [attendance]]
|
|
87
|
+
]));
|
|
88
|
+
const result = await countryAttendancePolicy.shouldIndex();
|
|
89
|
+
expect(result).toBe(false);
|
|
90
|
+
});
|
|
91
|
+
it('Should return false when multiple attendances are selected', async () => {
|
|
92
|
+
const countryId = '82'; // US
|
|
93
|
+
const firstAttendance = 'online';
|
|
94
|
+
const secondAttendance = 'blended';
|
|
95
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([
|
|
96
|
+
[FilterKey.DELIVERY_METHOD, [firstAttendance, secondAttendance]],
|
|
97
|
+
[FilterKey.COUNTRY, [countryId]]
|
|
98
|
+
]));
|
|
99
|
+
const result = await countryAttendancePolicy.shouldIndex();
|
|
100
|
+
expect(result).toBe(false);
|
|
101
|
+
});
|
|
102
|
+
it('Should return false when country has no search volume', async () => {
|
|
103
|
+
const countryId = '21'; // PT
|
|
104
|
+
const attendance = 'online';
|
|
105
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([
|
|
106
|
+
[FilterKey.DELIVERY_METHOD, [attendance]],
|
|
107
|
+
[FilterKey.COUNTRY, [countryId]]
|
|
108
|
+
]));
|
|
109
|
+
const result = await countryAttendancePolicy.shouldIndex();
|
|
110
|
+
expect(result).toBe(false);
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
describe('generateSitemapUrls', () => {
|
|
114
|
+
let sitemapDependenciesHelper;
|
|
115
|
+
let countryAttendancePolicy;
|
|
116
|
+
let countryFragments;
|
|
117
|
+
let attendanceFragments;
|
|
118
|
+
beforeEach(() => {
|
|
119
|
+
sitemapDependenciesHelper = new SitemapDependencies();
|
|
120
|
+
sitemapDependenciesHelper.setOrganisationCount(10);
|
|
121
|
+
countryAttendancePolicy = new CountryAttendance(sitemapDependenciesHelper.dependencies);
|
|
122
|
+
vi.spyOn(CountryPresenter, 'getInstance').mockReturnValue({
|
|
123
|
+
getFragments: vi.fn(() => countryFragments),
|
|
124
|
+
generatePaths: vi.fn(() => countryFragments),
|
|
125
|
+
fragments: countryFragments
|
|
126
|
+
});
|
|
127
|
+
vi.spyOn(AttendancePresenter, 'getInstance').mockReturnValue({
|
|
128
|
+
getFragments: vi.fn(() => attendanceFragments),
|
|
129
|
+
generatePaths: vi.fn(() => attendanceFragments),
|
|
130
|
+
fragments: attendanceFragments
|
|
131
|
+
});
|
|
132
|
+
});
|
|
133
|
+
it('Should return path when all conditions are met', async () => {
|
|
134
|
+
const countryId = '82'; // US
|
|
135
|
+
const countryIso = 'US';
|
|
136
|
+
const countryPath = 'country-path';
|
|
137
|
+
const attendance = 'online';
|
|
138
|
+
const attendancePath = 'attendance-path';
|
|
139
|
+
countryFragments = [
|
|
140
|
+
{
|
|
141
|
+
id: countryId,
|
|
142
|
+
iso: countryIso,
|
|
143
|
+
path: countryPath
|
|
144
|
+
}
|
|
145
|
+
];
|
|
146
|
+
attendanceFragments = [
|
|
147
|
+
{
|
|
148
|
+
id: attendance,
|
|
149
|
+
path: attendancePath
|
|
150
|
+
}
|
|
151
|
+
];
|
|
152
|
+
const result = await countryAttendancePolicy.generateSitemapUrls();
|
|
153
|
+
expect(result).toEqual([`${attendancePath}/${countryPath}`]);
|
|
154
|
+
});
|
|
155
|
+
it.each([[PortalType.BACHELOR], [PortalType.PHD], [PortalType.SHORT]])('Should not return path when portal type is %s', async (portalType) => {
|
|
156
|
+
const countryId = '82'; // US
|
|
157
|
+
const countryIso = 'US';
|
|
158
|
+
const countryPath = 'country-path';
|
|
159
|
+
const attendance = 'online';
|
|
160
|
+
const attendancePath = 'attendance-path';
|
|
161
|
+
countryFragments = [
|
|
162
|
+
{
|
|
163
|
+
id: countryId,
|
|
164
|
+
iso: countryIso,
|
|
165
|
+
path: countryPath
|
|
166
|
+
}
|
|
167
|
+
];
|
|
168
|
+
attendanceFragments = [
|
|
169
|
+
{
|
|
170
|
+
id: attendance,
|
|
171
|
+
path: attendancePath
|
|
172
|
+
}
|
|
173
|
+
];
|
|
174
|
+
sitemapDependenciesHelper.setPortalType(portalType);
|
|
175
|
+
const result = await countryAttendancePolicy.generateSitemapUrls();
|
|
176
|
+
expect(result).toEqual([]);
|
|
177
|
+
});
|
|
178
|
+
it('Should not return path when attendance is not online', async () => {
|
|
179
|
+
const countryId = '82'; // US
|
|
180
|
+
const countryIso = 'US';
|
|
181
|
+
const countryPath = 'country-path';
|
|
182
|
+
const attendance = 'face-2-face';
|
|
183
|
+
const attendancePath = 'attendance-path';
|
|
184
|
+
countryFragments = [
|
|
185
|
+
{
|
|
186
|
+
id: countryId,
|
|
187
|
+
iso: countryIso,
|
|
188
|
+
path: countryPath
|
|
189
|
+
}
|
|
190
|
+
];
|
|
191
|
+
attendanceFragments = [
|
|
192
|
+
{
|
|
193
|
+
id: attendance,
|
|
194
|
+
path: attendancePath
|
|
195
|
+
}
|
|
196
|
+
];
|
|
197
|
+
const result = await countryAttendancePolicy.generateSitemapUrls();
|
|
198
|
+
expect(result).toEqual([]);
|
|
199
|
+
});
|
|
200
|
+
it('Should not return path when there is not enough search volume', async () => {
|
|
201
|
+
const countryId = '21'; // PT
|
|
202
|
+
const countryIso = 'US';
|
|
203
|
+
const countryPath = 'country-path';
|
|
204
|
+
const attendance = 'online';
|
|
205
|
+
const attendancePath = 'attendance-path';
|
|
206
|
+
countryFragments = [
|
|
207
|
+
{
|
|
208
|
+
id: countryId,
|
|
209
|
+
iso: countryIso,
|
|
210
|
+
path: countryPath
|
|
211
|
+
}
|
|
212
|
+
];
|
|
213
|
+
attendanceFragments = [
|
|
214
|
+
{
|
|
215
|
+
id: attendance,
|
|
216
|
+
path: attendancePath
|
|
217
|
+
}
|
|
218
|
+
];
|
|
219
|
+
const result = await countryAttendancePolicy.generateSitemapUrls();
|
|
220
|
+
expect(result).toEqual([]);
|
|
221
|
+
});
|
|
222
|
+
});
|
|
223
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|