@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,151 @@
|
|
|
1
|
+
import { describe, it, expect, beforeEach, vi } from 'vitest';
|
|
2
|
+
import { FilterKey } from '@studyportals/search-filters/server-side';
|
|
3
|
+
import { SearchDependencies } from '../utils/SearchDependencies.util.mjs';
|
|
4
|
+
import { DisciplineCountry } from '@/scholarships/policies/DisciplineCountry';
|
|
5
|
+
import { SitemapDependencies } from '../utils/SitemapDependencies.util.mjs';
|
|
6
|
+
import { DisciplinePresenter } from '@/presenters/DisciplinePresenter';
|
|
7
|
+
import { CountryPresenter } from '@/presenters/CountryPresenter';
|
|
8
|
+
describe('Policy:DisciplineCountry', () => {
|
|
9
|
+
describe('shouldIndex', () => {
|
|
10
|
+
let searchDependenciesHelper;
|
|
11
|
+
let disciplineCountryPolicy;
|
|
12
|
+
beforeEach(() => {
|
|
13
|
+
searchDependenciesHelper = new SearchDependencies();
|
|
14
|
+
disciplineCountryPolicy = new DisciplineCountry(searchDependenciesHelper.dependencies);
|
|
15
|
+
});
|
|
16
|
+
it('Should return true when all conditions are met', async () => {
|
|
17
|
+
const disciplineId = '54'; // Agriculture & Forestry
|
|
18
|
+
const countryId = '30'; // UK
|
|
19
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([
|
|
20
|
+
[FilterKey.DISCIPLINES, [disciplineId]],
|
|
21
|
+
[FilterKey.COUNTRY, [countryId]]
|
|
22
|
+
]));
|
|
23
|
+
const result = await disciplineCountryPolicy.shouldIndex();
|
|
24
|
+
expect(result).toBe(true);
|
|
25
|
+
});
|
|
26
|
+
it('Should return false when multiple disciplines are selected', async () => {
|
|
27
|
+
const firstDisciplineId = '54'; // Agriculture & Forestry
|
|
28
|
+
const secondDisciplineId = '12'; // Applied Sciences & Professions
|
|
29
|
+
const countryId = '30'; // UK
|
|
30
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([
|
|
31
|
+
[FilterKey.DISCIPLINES, [firstDisciplineId, secondDisciplineId]],
|
|
32
|
+
[FilterKey.COUNTRY, [countryId]]
|
|
33
|
+
]));
|
|
34
|
+
const result = await disciplineCountryPolicy.shouldIndex();
|
|
35
|
+
expect(result).toBe(false);
|
|
36
|
+
});
|
|
37
|
+
it('Should return false when multiple countries are selected', async () => {
|
|
38
|
+
const disciplineId = '54'; // Agriculture & Forestry
|
|
39
|
+
const firstCountryId = '30'; // UK
|
|
40
|
+
const secondCountryId = '82'; // USA
|
|
41
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([
|
|
42
|
+
[FilterKey.DISCIPLINES, [disciplineId]],
|
|
43
|
+
[FilterKey.COUNTRY, [firstCountryId, secondCountryId]]
|
|
44
|
+
]));
|
|
45
|
+
const result = await disciplineCountryPolicy.shouldIndex();
|
|
46
|
+
expect(result).toBe(false);
|
|
47
|
+
});
|
|
48
|
+
it('Should return false when no disciplines are selected', async () => {
|
|
49
|
+
const countryId = '30'; // UK
|
|
50
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([[FilterKey.COUNTRY, [countryId]]]));
|
|
51
|
+
const result = await disciplineCountryPolicy.shouldIndex();
|
|
52
|
+
expect(result).toBe(false);
|
|
53
|
+
});
|
|
54
|
+
it('Should return false when no countries are selected', async () => {
|
|
55
|
+
const disciplineId = '54'; // Agriculture & Forestry
|
|
56
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([[FilterKey.DISCIPLINES, [disciplineId]]]));
|
|
57
|
+
const result = await disciplineCountryPolicy.shouldIndex();
|
|
58
|
+
expect(result).toBe(false);
|
|
59
|
+
});
|
|
60
|
+
it('Should return false when other filters are selected', async () => {
|
|
61
|
+
const disciplineId = '54'; // Agriculture & Forestry
|
|
62
|
+
const countryId = '30'; // UK
|
|
63
|
+
const areaId = '996';
|
|
64
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([
|
|
65
|
+
[FilterKey.COUNTRY, [countryId]],
|
|
66
|
+
[FilterKey.DISCIPLINES, [disciplineId]],
|
|
67
|
+
[FilterKey.AREA, [areaId]]
|
|
68
|
+
]));
|
|
69
|
+
const result = await disciplineCountryPolicy.shouldIndex();
|
|
70
|
+
expect(result).toBe(false);
|
|
71
|
+
});
|
|
72
|
+
it('Should return false when there is not enough search volume', async () => {
|
|
73
|
+
const disciplineId = '54'; // Agriculture & Forestry
|
|
74
|
+
const countryId = '199'; // Zambia
|
|
75
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([
|
|
76
|
+
[FilterKey.COUNTRY, [countryId]],
|
|
77
|
+
[FilterKey.DISCIPLINES, [disciplineId]]
|
|
78
|
+
]));
|
|
79
|
+
const result = await disciplineCountryPolicy.shouldIndex();
|
|
80
|
+
expect(result).toBe(false);
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
describe('generateSitemapUrls', () => {
|
|
84
|
+
let sitemapDependenciesHelper;
|
|
85
|
+
let disciplineCountryPolicy;
|
|
86
|
+
let disciplineFragments;
|
|
87
|
+
let countryFragments;
|
|
88
|
+
beforeEach(() => {
|
|
89
|
+
sitemapDependenciesHelper = new SitemapDependencies();
|
|
90
|
+
disciplineCountryPolicy = new DisciplineCountry(sitemapDependenciesHelper.dependencies);
|
|
91
|
+
vi.spyOn(DisciplinePresenter, 'getInstance').mockReturnValue({
|
|
92
|
+
getFragments: vi.fn(() => disciplineFragments),
|
|
93
|
+
generatePaths: vi.fn(() => disciplineFragments),
|
|
94
|
+
fragments: disciplineFragments
|
|
95
|
+
});
|
|
96
|
+
vi.spyOn(CountryPresenter, 'getInstance').mockReturnValue({
|
|
97
|
+
getFragments: vi.fn(() => countryFragments),
|
|
98
|
+
generatePaths: vi.fn(() => countryFragments),
|
|
99
|
+
fragments: countryFragments
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
it('Should return path when all conditions are met', async () => {
|
|
103
|
+
const disciplineId = '54'; // Agriculture & Forestry
|
|
104
|
+
const disciplinePath = 'discipline-path';
|
|
105
|
+
const countryId = '30'; // UK
|
|
106
|
+
const countryPath = 'country-path';
|
|
107
|
+
const countryIso = 'iso';
|
|
108
|
+
disciplineFragments = [
|
|
109
|
+
{
|
|
110
|
+
id: disciplineId,
|
|
111
|
+
path: disciplinePath
|
|
112
|
+
}
|
|
113
|
+
];
|
|
114
|
+
countryFragments = [
|
|
115
|
+
{
|
|
116
|
+
id: countryId,
|
|
117
|
+
path: countryPath,
|
|
118
|
+
iso: countryIso
|
|
119
|
+
}
|
|
120
|
+
];
|
|
121
|
+
const result = await disciplineCountryPolicy.generateSitemapUrls();
|
|
122
|
+
expect(result).toEqual([`${countryPath}/${disciplinePath}`]);
|
|
123
|
+
});
|
|
124
|
+
it('Should not return path when there is not enough search volume', async () => {
|
|
125
|
+
const disciplineId = '54'; // Agriculture & Forestry
|
|
126
|
+
const disciplinePath = 'discipline-path';
|
|
127
|
+
const countryId = '199'; // Zambia
|
|
128
|
+
const countryPath = 'country-path';
|
|
129
|
+
const countryIso = 'iso';
|
|
130
|
+
disciplineFragments = [
|
|
131
|
+
{
|
|
132
|
+
id: disciplineId,
|
|
133
|
+
path: disciplinePath
|
|
134
|
+
}
|
|
135
|
+
];
|
|
136
|
+
countryFragments = [
|
|
137
|
+
{
|
|
138
|
+
id: countryId,
|
|
139
|
+
path: countryPath,
|
|
140
|
+
iso: countryIso
|
|
141
|
+
}
|
|
142
|
+
];
|
|
143
|
+
const result = await disciplineCountryPolicy.generateSitemapUrls();
|
|
144
|
+
expect(result).toEqual([]);
|
|
145
|
+
});
|
|
146
|
+
it('Should return all rules', () => {
|
|
147
|
+
const rules = disciplineCountryPolicy.getAllRules();
|
|
148
|
+
expect(rules.length).toBeGreaterThan(1);
|
|
149
|
+
});
|
|
150
|
+
});
|
|
151
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { describe, it, expect, beforeEach } from 'vitest';
|
|
2
|
+
import { FilterKey } from '@studyportals/search-filters/server-side';
|
|
3
|
+
import { SearchDependencies } from '../utils/SearchDependencies.util.mjs';
|
|
4
|
+
import { Unfiltered } from '@/scholarships/policies/Unfiltered';
|
|
5
|
+
import { SitemapDependencies } from '../utils/SitemapDependencies.util.mjs';
|
|
6
|
+
describe('Policy:Unfiltered', () => {
|
|
7
|
+
describe('shouldIndex', () => {
|
|
8
|
+
let searchDependenciesHelper;
|
|
9
|
+
let unfilteredPolicy;
|
|
10
|
+
beforeEach(() => {
|
|
11
|
+
searchDependenciesHelper = new SearchDependencies();
|
|
12
|
+
unfilteredPolicy = new Unfiltered(searchDependenciesHelper.dependencies);
|
|
13
|
+
});
|
|
14
|
+
it('Should return true when no filters are selected', async () => {
|
|
15
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([]));
|
|
16
|
+
const result = await unfilteredPolicy.shouldIndex();
|
|
17
|
+
expect(result).toBe(true);
|
|
18
|
+
});
|
|
19
|
+
it('Should return false when at least 1 filter is selected', async () => {
|
|
20
|
+
const countryId = '30'; // UK
|
|
21
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([[FilterKey.COUNTRY, [countryId]]]));
|
|
22
|
+
const result = await unfilteredPolicy.shouldIndex();
|
|
23
|
+
expect(result).toBe(false);
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
describe('generateSitemapUrls', () => {
|
|
27
|
+
let sitemapDependenciesHelper;
|
|
28
|
+
let unfilteredPolicy;
|
|
29
|
+
beforeEach(() => {
|
|
30
|
+
sitemapDependenciesHelper = new SitemapDependencies();
|
|
31
|
+
unfilteredPolicy = new Unfiltered(sitemapDependenciesHelper.dependencies);
|
|
32
|
+
});
|
|
33
|
+
it('Should return path', async () => {
|
|
34
|
+
const result = await unfilteredPolicy.generateSitemapUrls();
|
|
35
|
+
expect(result).toEqual(['']);
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
it('Should return all rules', () => {
|
|
39
|
+
const searchDependenciesHelper = new SearchDependencies();
|
|
40
|
+
const unfilteredPolicy = new Unfiltered(searchDependenciesHelper.dependencies);
|
|
41
|
+
const rules = unfilteredPolicy.getAllRules();
|
|
42
|
+
expect(rules[0]).toEqual({});
|
|
43
|
+
});
|
|
44
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { describe, it, expect, beforeEach, vi } from 'vitest';
|
|
2
|
+
import { FilterKey } from '@studyportals/search-filters/server-side';
|
|
3
|
+
import { SearchDependencies } from '../utils/SearchDependencies.util.mjs';
|
|
4
|
+
import { UniversityCountry } from '@/scholarships/policies/UniversityCountry';
|
|
5
|
+
import { SitemapDependencies } from '../utils/SitemapDependencies.util.mjs';
|
|
6
|
+
import { CountryPresenter } from '@/presenters/CountryPresenter';
|
|
7
|
+
describe('Policy:UniversityCountry', () => {
|
|
8
|
+
describe('shouldIndex', () => {
|
|
9
|
+
let searchDependenciesHelper;
|
|
10
|
+
let universityCountryPolicy;
|
|
11
|
+
beforeEach(() => {
|
|
12
|
+
searchDependenciesHelper = new SearchDependencies();
|
|
13
|
+
universityCountryPolicy = new UniversityCountry(searchDependenciesHelper.dependencies);
|
|
14
|
+
});
|
|
15
|
+
it('Should return true when all conditions are met', async () => {
|
|
16
|
+
const organisationId = '12819'; // Studyportals
|
|
17
|
+
const countryId = '1'; // Netherlands
|
|
18
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([
|
|
19
|
+
[FilterKey.ORGANISATIONS, [organisationId]],
|
|
20
|
+
[FilterKey.COUNTRY, [countryId]]
|
|
21
|
+
]));
|
|
22
|
+
const result = await universityCountryPolicy.shouldIndex();
|
|
23
|
+
expect(result).toBe(true);
|
|
24
|
+
});
|
|
25
|
+
it('Should return false when multiple universities are selected', async () => {
|
|
26
|
+
const firstOrganisationId = '12819'; // Studyportals
|
|
27
|
+
const secondOrganisationId = '1'; // TU/E
|
|
28
|
+
const countryId = '1'; // Netherlands
|
|
29
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([
|
|
30
|
+
[FilterKey.ORGANISATIONS, [firstOrganisationId, secondOrganisationId]],
|
|
31
|
+
[FilterKey.COUNTRY, [countryId]]
|
|
32
|
+
]));
|
|
33
|
+
const result = await universityCountryPolicy.shouldIndex();
|
|
34
|
+
expect(result).toBe(false);
|
|
35
|
+
});
|
|
36
|
+
it('Should return false when multiple countries are selected', async () => {
|
|
37
|
+
const organisationId = '12819'; // Studyportals
|
|
38
|
+
const firstCountryId = '1'; // Netherlands
|
|
39
|
+
const secondCountryId = '30'; // UK
|
|
40
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([
|
|
41
|
+
[FilterKey.ORGANISATIONS, [organisationId]],
|
|
42
|
+
[FilterKey.COUNTRY, [firstCountryId, secondCountryId]]
|
|
43
|
+
]));
|
|
44
|
+
const result = await universityCountryPolicy.shouldIndex();
|
|
45
|
+
expect(result).toBe(false);
|
|
46
|
+
});
|
|
47
|
+
it('Should return false when no organisations are selected', async () => {
|
|
48
|
+
const countryId = '1'; // Netherlands
|
|
49
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([[FilterKey.COUNTRY, [countryId]]]));
|
|
50
|
+
const result = await universityCountryPolicy.shouldIndex();
|
|
51
|
+
expect(result).toBe(false);
|
|
52
|
+
});
|
|
53
|
+
it('Should return false when no countries are selected', async () => {
|
|
54
|
+
const organisationId = '12819'; // Studyportals
|
|
55
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([[FilterKey.ORGANISATIONS, [organisationId]]]));
|
|
56
|
+
const result = await universityCountryPolicy.shouldIndex();
|
|
57
|
+
expect(result).toBe(false);
|
|
58
|
+
});
|
|
59
|
+
it('Should return false when other filters are selected', async () => {
|
|
60
|
+
const organisationId = '12819'; // Studyportals
|
|
61
|
+
const countryId = '1'; // Netherlands
|
|
62
|
+
const disciplineId = '54'; // Agriculture & Forestry
|
|
63
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([
|
|
64
|
+
[FilterKey.ORGANISATIONS, [organisationId]],
|
|
65
|
+
[FilterKey.COUNTRY, [countryId]],
|
|
66
|
+
[FilterKey.DISCIPLINES, [disciplineId]]
|
|
67
|
+
]));
|
|
68
|
+
const result = await universityCountryPolicy.shouldIndex();
|
|
69
|
+
expect(result).toBe(false);
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
describe('generateSitemapUrls', () => {
|
|
73
|
+
let sitemapDependenciesHelper;
|
|
74
|
+
let universityCountryPolicy;
|
|
75
|
+
let countryFragments;
|
|
76
|
+
beforeEach(() => {
|
|
77
|
+
sitemapDependenciesHelper = new SitemapDependencies();
|
|
78
|
+
universityCountryPolicy = new UniversityCountry(sitemapDependenciesHelper.dependencies);
|
|
79
|
+
vi.spyOn(CountryPresenter, 'getInstance').mockReturnValue({
|
|
80
|
+
getFragments: vi.fn(() => countryFragments),
|
|
81
|
+
generatePaths: vi.fn(() => countryFragments),
|
|
82
|
+
countryFragments
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
it('Should return path when all conditions are met', async () => {
|
|
86
|
+
const countryId = '30'; // UK
|
|
87
|
+
const countryPath = 'country-path';
|
|
88
|
+
const countryIso = 'ISO';
|
|
89
|
+
const organisationId = 12819;
|
|
90
|
+
const organisationName = 'Studyportals';
|
|
91
|
+
const organisationPath = 'organisation-path';
|
|
92
|
+
sitemapDependenciesHelper.setOrganisations([
|
|
93
|
+
{
|
|
94
|
+
id: organisationId,
|
|
95
|
+
name: organisationName,
|
|
96
|
+
virtualPath: organisationPath,
|
|
97
|
+
countryIsoCodes: [countryIso]
|
|
98
|
+
}
|
|
99
|
+
]);
|
|
100
|
+
countryFragments = [
|
|
101
|
+
{
|
|
102
|
+
id: countryId,
|
|
103
|
+
path: countryPath,
|
|
104
|
+
iso: countryIso
|
|
105
|
+
}
|
|
106
|
+
];
|
|
107
|
+
const result = await universityCountryPolicy.generateSitemapUrls();
|
|
108
|
+
expect(result).toEqual([`${countryPath}/${organisationPath}`]);
|
|
109
|
+
});
|
|
110
|
+
it('Should return all rules', () => {
|
|
111
|
+
const rules = universityCountryPolicy.getAllRules();
|
|
112
|
+
expect(rules.length).toBeGreaterThan(1);
|
|
113
|
+
});
|
|
114
|
+
});
|
|
115
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { beforeEach, describe, expect, it } from 'vitest';
|
|
2
|
+
import { SearchDependencies } from '../utils/SearchDependencies.util.mjs';
|
|
3
|
+
import { ExceptAustraliaAreasRule } from '@/scholarships/rules/ExceptAustaliaAreasRule';
|
|
4
|
+
import { FilterKey } from '@studyportals/search-filters/server-side';
|
|
5
|
+
describe('Rule:ExceptAustaliaAreas', () => {
|
|
6
|
+
describe('forSearch', () => {
|
|
7
|
+
let searchDependenciesHelper;
|
|
8
|
+
let rule;
|
|
9
|
+
beforeEach(() => {
|
|
10
|
+
searchDependenciesHelper = new SearchDependencies();
|
|
11
|
+
rule = new ExceptAustraliaAreasRule();
|
|
12
|
+
});
|
|
13
|
+
it('Returns true if area is not in Australia', async () => {
|
|
14
|
+
const areaId = '996'; // England
|
|
15
|
+
const countryId = '30'; // UK
|
|
16
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([
|
|
17
|
+
[FilterKey.AREA, [areaId]],
|
|
18
|
+
[FilterKey.COUNTRY, [countryId]]
|
|
19
|
+
]));
|
|
20
|
+
const result = await rule.forSearch(searchDependenciesHelper.dependencies);
|
|
21
|
+
expect(result).toBe(true);
|
|
22
|
+
});
|
|
23
|
+
it('Returns false if area is in Australia', async () => {
|
|
24
|
+
const areaId = '137'; // Western Australia
|
|
25
|
+
const countryId = '202'; // Australia
|
|
26
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([
|
|
27
|
+
[FilterKey.AREA, [areaId]],
|
|
28
|
+
[FilterKey.COUNTRY, [countryId]]
|
|
29
|
+
]));
|
|
30
|
+
const result = await rule.forSearch(searchDependenciesHelper.dependencies);
|
|
31
|
+
expect(result).toBe(false);
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
describe('forSitemapGenerator', () => {
|
|
35
|
+
let rule;
|
|
36
|
+
beforeEach(() => {
|
|
37
|
+
rule = new ExceptAustraliaAreasRule();
|
|
38
|
+
});
|
|
39
|
+
it('Returns true if country is not Australia', async () => {
|
|
40
|
+
const countryId = '30'; // UK
|
|
41
|
+
const result = await rule.forSitemapGenerator(new Map([[FilterKey.COUNTRY, [countryId]]]));
|
|
42
|
+
expect(result).toBe(true);
|
|
43
|
+
});
|
|
44
|
+
it('Returns false if country is Australia', async () => {
|
|
45
|
+
const countryId = '202'; // Australia
|
|
46
|
+
const result = await rule.forSitemapGenerator(new Map([[FilterKey.COUNTRY, [countryId]]]));
|
|
47
|
+
expect(result).toBe(false);
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
describe('forDocumentation', () => {
|
|
51
|
+
let rule;
|
|
52
|
+
beforeEach(() => {
|
|
53
|
+
rule = new ExceptAustraliaAreasRule();
|
|
54
|
+
});
|
|
55
|
+
it('Returns description', () => {
|
|
56
|
+
const result = rule.getName();
|
|
57
|
+
expect(typeof result).toBe('string');
|
|
58
|
+
});
|
|
59
|
+
it('Returns name', () => {
|
|
60
|
+
const result = rule.getDescription();
|
|
61
|
+
expect(typeof result).toBe('string');
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { beforeEach, describe, expect, it } from 'vitest';
|
|
2
|
+
import { SearchDependencies } from '../utils/SearchDependencies.util.mjs';
|
|
3
|
+
import { SearchVolumeAreasRule } from '@/scholarships/rules/SearchVolumeAreasRule';
|
|
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 SearchVolumeAreasRule();
|
|
12
|
+
});
|
|
13
|
+
it('Returns true if area has enough search volume', async () => {
|
|
14
|
+
const areaId = '996'; // England
|
|
15
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([[FilterKey.AREA, [areaId]]]));
|
|
16
|
+
const result = await rule.forSearch(searchDependenciesHelper.dependencies);
|
|
17
|
+
expect(result).toBe(true);
|
|
18
|
+
});
|
|
19
|
+
it('Returns false if area does not have enough search volume', async () => {
|
|
20
|
+
const areaId = '995'; // N. Ireland
|
|
21
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([[FilterKey.AREA, [areaId]]]));
|
|
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 SearchVolumeAreasRule();
|
|
30
|
+
});
|
|
31
|
+
it('Returns true if area has enough search volume', async () => {
|
|
32
|
+
const areaId = '996'; // England
|
|
33
|
+
const result = await rule.forSitemapGenerator(new Map([[FilterKey.AREA, [areaId]]]));
|
|
34
|
+
expect(result).toBe(true);
|
|
35
|
+
});
|
|
36
|
+
it('Returns false if area does not have enough search volume', async () => {
|
|
37
|
+
const areaId = '995'; // N. Ireland
|
|
38
|
+
const result = await rule.forSitemapGenerator(new Map([[FilterKey.AREA, [areaId]]]));
|
|
39
|
+
expect(result).toBe(false);
|
|
40
|
+
});
|
|
41
|
+
it('Returns false if multiple areas are selected', async () => {
|
|
42
|
+
const firstAreaId = '993'; // Wales
|
|
43
|
+
const secondAreaId = '996'; // England
|
|
44
|
+
const result = await rule.forSitemapGenerator(new Map([[FilterKey.AREA, [firstAreaId, secondAreaId]]]));
|
|
45
|
+
expect(result).toBe(false);
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
describe('forDocumentation', () => {
|
|
49
|
+
let rule;
|
|
50
|
+
beforeEach(() => {
|
|
51
|
+
rule = new SearchVolumeAreasRule();
|
|
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
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { beforeEach, describe, expect, it } from 'vitest';
|
|
2
|
+
import { SearchDependencies } from '../utils/SearchDependencies.util.mjs';
|
|
3
|
+
import { SearchVolumeCountriesDisciplinesRule } from '@/scholarships/rules/SearchVolumeCountriesDisciplinesRule';
|
|
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 SearchVolumeCountriesDisciplinesRule();
|
|
12
|
+
});
|
|
13
|
+
it('Returns true if combination has search volume', async () => {
|
|
14
|
+
const disciplineId = '54'; // Agriculture & Forestry
|
|
15
|
+
const countryId = '30'; // UK
|
|
16
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([
|
|
17
|
+
[FilterKey.DISCIPLINES, [disciplineId]],
|
|
18
|
+
[FilterKey.COUNTRY, [countryId]]
|
|
19
|
+
]));
|
|
20
|
+
const result = await rule.forSearch(searchDependenciesHelper.dependencies);
|
|
21
|
+
expect(result).toBe(true);
|
|
22
|
+
});
|
|
23
|
+
it('Returns false if combination does not have search volume', async () => {
|
|
24
|
+
const disciplineId = '54'; // Agriculture & Forestry
|
|
25
|
+
const countryId = '199'; // Zambia
|
|
26
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([
|
|
27
|
+
[FilterKey.DISCIPLINES, [disciplineId]],
|
|
28
|
+
[FilterKey.COUNTRY, [countryId]]
|
|
29
|
+
]));
|
|
30
|
+
const result = await rule.forSearch(searchDependenciesHelper.dependencies);
|
|
31
|
+
expect(result).toBe(false);
|
|
32
|
+
});
|
|
33
|
+
it('Returns false if no countries are selected', async () => {
|
|
34
|
+
const disciplineId = '54'; // Agriculture & Forestry
|
|
35
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([[FilterKey.DISCIPLINES, [disciplineId]]]));
|
|
36
|
+
const result = await rule.forSearch(searchDependenciesHelper.dependencies);
|
|
37
|
+
expect(result).toBe(false);
|
|
38
|
+
});
|
|
39
|
+
it('Returns false if no disciplines are selected', async () => {
|
|
40
|
+
const countryId = '30'; // UK
|
|
41
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([[FilterKey.COUNTRY, [countryId]]]));
|
|
42
|
+
const result = await rule.forSearch(searchDependenciesHelper.dependencies);
|
|
43
|
+
expect(result).toBe(false);
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
describe('forSitemapGenerator', () => {
|
|
47
|
+
let rule;
|
|
48
|
+
beforeEach(() => {
|
|
49
|
+
rule = new SearchVolumeCountriesDisciplinesRule();
|
|
50
|
+
});
|
|
51
|
+
it('Returns true if combination has search volume', async () => {
|
|
52
|
+
const disciplineId = '54'; // Agriculture & Forestry
|
|
53
|
+
const countryId = '30'; // UK
|
|
54
|
+
const result = await rule.forSitemapGenerator(new Map([
|
|
55
|
+
[FilterKey.DISCIPLINES, [disciplineId]],
|
|
56
|
+
[FilterKey.COUNTRY, [countryId]]
|
|
57
|
+
]));
|
|
58
|
+
expect(result).toBe(true);
|
|
59
|
+
});
|
|
60
|
+
it('Returns false if combination does not have search volume', async () => {
|
|
61
|
+
const disciplineId = '54'; // Agriculture & Forestry
|
|
62
|
+
const countryId = '199'; // Zambia
|
|
63
|
+
const result = await rule.forSitemapGenerator(new Map([
|
|
64
|
+
[FilterKey.DISCIPLINES, [disciplineId]],
|
|
65
|
+
[FilterKey.COUNTRY, [countryId]]
|
|
66
|
+
]));
|
|
67
|
+
expect(result).toBe(false);
|
|
68
|
+
});
|
|
69
|
+
it('Returns false if multiple countries are selected', async () => {
|
|
70
|
+
const disciplineId = '54'; // Agriculture & Forestry
|
|
71
|
+
const firstCountryId = '30'; // UK
|
|
72
|
+
const secondCountryId = '82'; // USA
|
|
73
|
+
const result = await rule.forSitemapGenerator(new Map([
|
|
74
|
+
[FilterKey.DISCIPLINES, [disciplineId]],
|
|
75
|
+
[FilterKey.COUNTRY, [firstCountryId, secondCountryId]]
|
|
76
|
+
]));
|
|
77
|
+
expect(result).toBe(false);
|
|
78
|
+
});
|
|
79
|
+
it('Returns false if multiple disciplines are selected', async () => {
|
|
80
|
+
const firstDisciplineId = '54'; // Agriculture & Forestry
|
|
81
|
+
const secondDisciplineId = '12'; // Applied Sciences & Professions
|
|
82
|
+
const countryId = '30'; // UK
|
|
83
|
+
const result = await rule.forSitemapGenerator(new Map([
|
|
84
|
+
[FilterKey.DISCIPLINES, [firstDisciplineId, secondDisciplineId]],
|
|
85
|
+
[FilterKey.COUNTRY, [countryId]]
|
|
86
|
+
]));
|
|
87
|
+
expect(result).toBe(false);
|
|
88
|
+
});
|
|
89
|
+
it('Returns false if no countries are selected', async () => {
|
|
90
|
+
const disciplineId = '54'; // Agriculture & Forestry
|
|
91
|
+
const result = await rule.forSitemapGenerator(new Map([[FilterKey.DISCIPLINES, [disciplineId]]]));
|
|
92
|
+
expect(result).toBe(false);
|
|
93
|
+
});
|
|
94
|
+
it('Returns false if no disciplines are selected', async () => {
|
|
95
|
+
const countryId = '30'; // UK
|
|
96
|
+
const result = await rule.forSitemapGenerator(new Map([[FilterKey.COUNTRY, [countryId]]]));
|
|
97
|
+
expect(result).toBe(false);
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
describe('forDocumentation', () => {
|
|
101
|
+
let rule;
|
|
102
|
+
beforeEach(() => {
|
|
103
|
+
rule = new SearchVolumeCountriesDisciplinesRule();
|
|
104
|
+
});
|
|
105
|
+
it('Returns description', () => {
|
|
106
|
+
const result = rule.getName();
|
|
107
|
+
expect(typeof result).toBe('string');
|
|
108
|
+
});
|
|
109
|
+
it('Returns name', () => {
|
|
110
|
+
const result = rule.getDescription();
|
|
111
|
+
expect(typeof result).toBe('string');
|
|
112
|
+
});
|
|
113
|
+
});
|
|
114
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { beforeEach, describe, expect, it } from 'vitest';
|
|
2
|
+
import { SearchDependencies } from '../utils/SearchDependencies.util.mjs';
|
|
3
|
+
import { SearchVolumeCountriesRule } from '@/scholarships/rules/SearchVolumeCountriesRule';
|
|
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 SearchVolumeCountriesRule();
|
|
12
|
+
});
|
|
13
|
+
it('Returns true if country has enough search volume', async () => {
|
|
14
|
+
const countryId = '30'; // UK
|
|
15
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([[FilterKey.COUNTRY, [countryId]]]));
|
|
16
|
+
const result = await rule.forSearch(searchDependenciesHelper.dependencies);
|
|
17
|
+
expect(result).toBe(true);
|
|
18
|
+
});
|
|
19
|
+
it('Returns false if country does not have enough search volume', async () => {
|
|
20
|
+
const countryId = '122'; // Macao
|
|
21
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([[FilterKey.COUNTRY, [countryId]]]));
|
|
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 SearchVolumeCountriesRule();
|
|
30
|
+
});
|
|
31
|
+
it('Returns true if country has enough search volume', async () => {
|
|
32
|
+
const countryId = '30'; // UK
|
|
33
|
+
const result = await rule.forSitemapGenerator(new Map([[FilterKey.COUNTRY, [countryId]]]));
|
|
34
|
+
expect(result).toBe(true);
|
|
35
|
+
});
|
|
36
|
+
it('Returns false if country does not have enough search volume', async () => {
|
|
37
|
+
const countryId = '122'; // Macao
|
|
38
|
+
const result = await rule.forSitemapGenerator(new Map([[FilterKey.COUNTRY, [countryId]]]));
|
|
39
|
+
expect(result).toBe(false);
|
|
40
|
+
});
|
|
41
|
+
it('Returns false if multiple countries are selected', async () => {
|
|
42
|
+
const firstCountryId = '30'; // UK
|
|
43
|
+
const secondCountryId = '82'; // USA
|
|
44
|
+
const result = await rule.forSitemapGenerator(new Map([[FilterKey.COUNTRY, [firstCountryId, secondCountryId]]]));
|
|
45
|
+
expect(result).toBe(false);
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
describe('forDocumentation', () => {
|
|
49
|
+
let rule;
|
|
50
|
+
beforeEach(() => {
|
|
51
|
+
rule = new SearchVolumeCountriesRule();
|
|
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
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|