@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,59 @@
|
|
|
1
|
+
import { beforeEach, describe, expect, it } from 'vitest';
|
|
2
|
+
import { SearchDependencies } from '../utils/SearchDependencies.util.mjs';
|
|
3
|
+
import { OnlineAttendanceRule } from '@/common/rules/OnlineAttendanceRule';
|
|
4
|
+
import { FilterKey } from '@studyportals/search-filters/server-side';
|
|
5
|
+
describe('Rule:OnlineAttendance', () => {
|
|
6
|
+
describe('forSearch', () => {
|
|
7
|
+
let searchDependenciesHelper;
|
|
8
|
+
let rule;
|
|
9
|
+
beforeEach(() => {
|
|
10
|
+
searchDependenciesHelper = new SearchDependencies();
|
|
11
|
+
rule = new OnlineAttendanceRule();
|
|
12
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([]));
|
|
13
|
+
});
|
|
14
|
+
it('Returns true if selected attendance is online', async () => {
|
|
15
|
+
const attendanceId = 'online';
|
|
16
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([[FilterKey.DELIVERY_METHOD, [attendanceId]]]));
|
|
17
|
+
const result = await rule.forSearch(searchDependenciesHelper.dependencies);
|
|
18
|
+
expect(result).toBe(true);
|
|
19
|
+
});
|
|
20
|
+
it('Returns false if selected attendance is not online', async () => {
|
|
21
|
+
const attendanceId = 'not-online';
|
|
22
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([[FilterKey.DELIVERY_METHOD, [attendanceId]]]));
|
|
23
|
+
const result = await rule.forSearch(searchDependenciesHelper.dependencies);
|
|
24
|
+
expect(result).toBe(false);
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
describe('forSitemapGenerator', () => {
|
|
28
|
+
let rule;
|
|
29
|
+
beforeEach(() => {
|
|
30
|
+
rule = new OnlineAttendanceRule();
|
|
31
|
+
});
|
|
32
|
+
it('Returns true if selected attendance is online', async () => {
|
|
33
|
+
const attendanceId = 'online';
|
|
34
|
+
const filterKeyValues = new Map([[FilterKey.DELIVERY_METHOD, [attendanceId]]]);
|
|
35
|
+
const result = await rule.forSitemapGenerator(filterKeyValues);
|
|
36
|
+
expect(result).toBe(true);
|
|
37
|
+
});
|
|
38
|
+
it('Returns false if selected attendance is not online', async () => {
|
|
39
|
+
const attendanceId = 'not-online';
|
|
40
|
+
const filterKeyValues = new Map([[FilterKey.DELIVERY_METHOD, [attendanceId]]]);
|
|
41
|
+
const result = await rule.forSitemapGenerator(filterKeyValues);
|
|
42
|
+
expect(result).toBe(false);
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
describe('forDocumentation', () => {
|
|
46
|
+
let rule;
|
|
47
|
+
beforeEach(() => {
|
|
48
|
+
rule = new OnlineAttendanceRule();
|
|
49
|
+
});
|
|
50
|
+
it('Returns description', () => {
|
|
51
|
+
const result = rule.getName();
|
|
52
|
+
expect(typeof result).toBe('string');
|
|
53
|
+
});
|
|
54
|
+
it('Returns name', () => {
|
|
55
|
+
const result = rule.getDescription();
|
|
56
|
+
expect(typeof result).toBe('string');
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { beforeEach, describe, expect, it } from 'vitest';
|
|
2
|
+
import { SearchDependencies } from '../utils/SearchDependencies.util.mjs';
|
|
3
|
+
import { SearchVolumeAreasAttendanceRule } from '@/organisations/rules/SearchVolumeAreasAttendanceRule';
|
|
4
|
+
import { FilterKey } from '@studyportals/search-filters/server-side';
|
|
5
|
+
describe('Rule:SearchVolumeAreasAttendance', () => {
|
|
6
|
+
describe('forSearch', () => {
|
|
7
|
+
let searchDependenciesHelper;
|
|
8
|
+
let rule;
|
|
9
|
+
beforeEach(() => {
|
|
10
|
+
searchDependenciesHelper = new SearchDependencies();
|
|
11
|
+
rule = new SearchVolumeAreasAttendanceRule();
|
|
12
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([]));
|
|
13
|
+
});
|
|
14
|
+
it('Returns true if selected area has search volume', async () => {
|
|
15
|
+
const areaId = '3592'; // Texas
|
|
16
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([[FilterKey.AREA, [areaId]]]));
|
|
17
|
+
const result = await rule.forSearch(searchDependenciesHelper.dependencies);
|
|
18
|
+
expect(result).toBe(true);
|
|
19
|
+
});
|
|
20
|
+
it('Returns false if selected attendance is not online', async () => {
|
|
21
|
+
const areaId = '994'; // Scotland
|
|
22
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([[FilterKey.AREA, [areaId]]]));
|
|
23
|
+
const result = await rule.forSearch(searchDependenciesHelper.dependencies);
|
|
24
|
+
expect(result).toBe(false);
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
describe('forSitemapGenerator', () => {
|
|
28
|
+
let rule;
|
|
29
|
+
beforeEach(() => {
|
|
30
|
+
rule = new SearchVolumeAreasAttendanceRule();
|
|
31
|
+
});
|
|
32
|
+
it('Returns true if selected area has search volume', async () => {
|
|
33
|
+
const areaId = '3592'; // Texas
|
|
34
|
+
const filterKeyValues = new Map([[FilterKey.AREA, [areaId]]]);
|
|
35
|
+
const result = await rule.forSitemapGenerator(filterKeyValues);
|
|
36
|
+
expect(result).toBe(true);
|
|
37
|
+
});
|
|
38
|
+
it('Returns false if selected attendance is not online', async () => {
|
|
39
|
+
const areaId = '994'; // Scotland
|
|
40
|
+
const filterKeyValues = new Map([[FilterKey.AREA, [areaId]]]);
|
|
41
|
+
const result = await rule.forSitemapGenerator(filterKeyValues);
|
|
42
|
+
expect(result).toBe(false);
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
describe('forDocumentation', () => {
|
|
46
|
+
let rule;
|
|
47
|
+
beforeEach(() => {
|
|
48
|
+
rule = new SearchVolumeAreasAttendanceRule();
|
|
49
|
+
});
|
|
50
|
+
it('Returns description', () => {
|
|
51
|
+
const result = rule.getName();
|
|
52
|
+
expect(typeof result).toBe('string');
|
|
53
|
+
});
|
|
54
|
+
it('Returns name', () => {
|
|
55
|
+
const result = rule.getDescription();
|
|
56
|
+
expect(typeof result).toBe('string');
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { beforeEach, describe, expect, it } from 'vitest';
|
|
2
|
+
import { SearchDependencies } from '../utils/SearchDependencies.util.mjs';
|
|
3
|
+
import { SearchVolumeAreasDisciplineRule } from '@/organisations/rules/SearchVolumeAreasDisciplineRule';
|
|
4
|
+
import { FilterKey } from '@studyportals/search-filters/server-side';
|
|
5
|
+
describe('Rule:SearchVolumeAreasDiscipline', () => {
|
|
6
|
+
describe('forSearch', () => {
|
|
7
|
+
let searchDependenciesHelper;
|
|
8
|
+
let rule;
|
|
9
|
+
beforeEach(() => {
|
|
10
|
+
searchDependenciesHelper = new SearchDependencies();
|
|
11
|
+
rule = new SearchVolumeAreasDisciplineRule();
|
|
12
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([]));
|
|
13
|
+
});
|
|
14
|
+
it('Returns true if selected area has search volume', async () => {
|
|
15
|
+
const areaId = '3592'; // Texas
|
|
16
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([[FilterKey.AREA, [areaId]]]));
|
|
17
|
+
const result = await rule.forSearch(searchDependenciesHelper.dependencies);
|
|
18
|
+
expect(result).toBe(true);
|
|
19
|
+
});
|
|
20
|
+
it('Returns false if selected attendance is not online', async () => {
|
|
21
|
+
const areaId = '994'; // Scotland
|
|
22
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([[FilterKey.AREA, [areaId]]]));
|
|
23
|
+
const result = await rule.forSearch(searchDependenciesHelper.dependencies);
|
|
24
|
+
expect(result).toBe(false);
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
describe('forSitemapGenerator', () => {
|
|
28
|
+
let rule;
|
|
29
|
+
beforeEach(() => {
|
|
30
|
+
rule = new SearchVolumeAreasDisciplineRule();
|
|
31
|
+
});
|
|
32
|
+
it('Returns true if selected area has search volume', async () => {
|
|
33
|
+
const areaId = '3592'; // Texas
|
|
34
|
+
const filterKeyValues = new Map([[FilterKey.AREA, [areaId]]]);
|
|
35
|
+
const result = await rule.forSitemapGenerator(filterKeyValues);
|
|
36
|
+
expect(result).toBe(true);
|
|
37
|
+
});
|
|
38
|
+
it('Returns false if selected attendance is not online', async () => {
|
|
39
|
+
const areaId = '994'; // Scotland
|
|
40
|
+
const filterKeyValues = new Map([[FilterKey.AREA, [areaId]]]);
|
|
41
|
+
const result = await rule.forSitemapGenerator(filterKeyValues);
|
|
42
|
+
expect(result).toBe(false);
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
describe('forDocumentation', () => {
|
|
46
|
+
let rule;
|
|
47
|
+
beforeEach(() => {
|
|
48
|
+
rule = new SearchVolumeAreasDisciplineRule();
|
|
49
|
+
});
|
|
50
|
+
it('Returns description', () => {
|
|
51
|
+
const result = rule.getName();
|
|
52
|
+
expect(typeof result).toBe('string');
|
|
53
|
+
});
|
|
54
|
+
it('Returns name', () => {
|
|
55
|
+
const result = rule.getDescription();
|
|
56
|
+
expect(typeof result).toBe('string');
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { beforeEach, describe, expect, it } from 'vitest';
|
|
2
|
+
import { SearchDependencies } from '../utils/SearchDependencies.util.mjs';
|
|
3
|
+
import { SearchVolumeCountriesAttendanceRule } from '@/organisations/rules/SearchVolumeCountriesAttendanceRule';
|
|
4
|
+
import { FilterKey } from '@studyportals/search-filters/server-side';
|
|
5
|
+
describe('Rule:SearchVolumeCountriesAttendance', () => {
|
|
6
|
+
describe('forSearch', () => {
|
|
7
|
+
let searchDependenciesHelper;
|
|
8
|
+
let rule;
|
|
9
|
+
beforeEach(() => {
|
|
10
|
+
searchDependenciesHelper = new SearchDependencies();
|
|
11
|
+
rule = new SearchVolumeCountriesAttendanceRule();
|
|
12
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([]));
|
|
13
|
+
});
|
|
14
|
+
it('Returns true if selected country is online', async () => {
|
|
15
|
+
const countryId = '108'; // India
|
|
16
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([[FilterKey.COUNTRY, [countryId]]]));
|
|
17
|
+
const result = await rule.forSearch(searchDependenciesHelper.dependencies);
|
|
18
|
+
expect(result).toBe(true);
|
|
19
|
+
});
|
|
20
|
+
it('Returns false if selected country is not online', async () => {
|
|
21
|
+
const countryId = '1'; // Netherlands
|
|
22
|
+
searchDependenciesHelper.setFilterKeyValues(new Map([[FilterKey.COUNTRY, [countryId]]]));
|
|
23
|
+
const result = await rule.forSearch(searchDependenciesHelper.dependencies);
|
|
24
|
+
expect(result).toBe(false);
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
describe('forSitemapGenerator', () => {
|
|
28
|
+
let rule;
|
|
29
|
+
beforeEach(() => {
|
|
30
|
+
rule = new SearchVolumeCountriesAttendanceRule();
|
|
31
|
+
});
|
|
32
|
+
it('Returns true if selected country is online', async () => {
|
|
33
|
+
const countryId = '108'; // India
|
|
34
|
+
const filterKeyValues = new Map([[FilterKey.COUNTRY, [countryId]]]);
|
|
35
|
+
const result = await rule.forSitemapGenerator(filterKeyValues);
|
|
36
|
+
expect(result).toBe(true);
|
|
37
|
+
});
|
|
38
|
+
it('Returns false if selected country is not online', async () => {
|
|
39
|
+
const countryId = '1'; // Netherlands
|
|
40
|
+
const filterKeyValues = new Map([[FilterKey.COUNTRY, [countryId]]]);
|
|
41
|
+
const result = await rule.forSitemapGenerator(filterKeyValues);
|
|
42
|
+
expect(result).toBe(false);
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
describe('forDocumentation', () => {
|
|
46
|
+
let rule;
|
|
47
|
+
beforeEach(() => {
|
|
48
|
+
rule = new SearchVolumeCountriesAttendanceRule();
|
|
49
|
+
});
|
|
50
|
+
it('Returns description', () => {
|
|
51
|
+
const result = rule.getName();
|
|
52
|
+
expect(typeof result).toBe('string');
|
|
53
|
+
});
|
|
54
|
+
it('Returns name', () => {
|
|
55
|
+
const result = rule.getDescription();
|
|
56
|
+
expect(typeof result).toBe('string');
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { IOrganisationSearchDependencies } from '@/organisations/types/IOrganisationSearchDependencies';
|
|
2
|
+
import { ISeoInfoBase } from '@/common/ISeoInfoBase';
|
|
3
|
+
import { ISeoFilterState } from '@/common';
|
|
4
|
+
import { DependencyTypes } from '@/enums/DependencyTypes';
|
|
5
|
+
import { FilterKeyValuesMap } from '@/common/FilterKeyValuesMap';
|
|
6
|
+
import { PortalType } from '@studyportals/domain-client';
|
|
7
|
+
import { SortingOptions } from '@/enums/SortingOptions';
|
|
8
|
+
export declare class SearchDependencies {
|
|
9
|
+
readonly dependencies: IOrganisationSearchDependencies;
|
|
10
|
+
constructor();
|
|
11
|
+
get seoInfoBase(): ISeoInfoBase;
|
|
12
|
+
get filterState(): ISeoFilterState;
|
|
13
|
+
get dependencyType(): DependencyTypes;
|
|
14
|
+
setSortingState(option: SortingOptions): void;
|
|
15
|
+
setRankedResultsCount(count: number): void;
|
|
16
|
+
setPageNumber(pageNumber: number): void;
|
|
17
|
+
setNumberOfResults(count: number): void;
|
|
18
|
+
setPortalType(portalType: PortalType): void;
|
|
19
|
+
setFilterKeyValues(filterKeyValues: FilterKeyValuesMap): void;
|
|
20
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { vi } from 'vitest';
|
|
2
|
+
import { DependencyTypes } from '@/enums/DependencyTypes';
|
|
3
|
+
import { PortalType } from '@studyportals/domain-client';
|
|
4
|
+
export class SearchDependencies {
|
|
5
|
+
dependencies;
|
|
6
|
+
constructor() {
|
|
7
|
+
const seoInfoBase = {
|
|
8
|
+
singleSelectionFor: vi.fn(),
|
|
9
|
+
selectionOnlyFor: vi.fn(),
|
|
10
|
+
getFilterOptionValueBy: vi.fn(),
|
|
11
|
+
getSelectionTypeCount: vi.fn()
|
|
12
|
+
};
|
|
13
|
+
const sortingState = {
|
|
14
|
+
getSelectedOption: vi.fn()
|
|
15
|
+
};
|
|
16
|
+
const applicationState = {
|
|
17
|
+
getRankedResultsCount: vi.fn(),
|
|
18
|
+
getPageNumber: vi.fn().mockReturnValue(1),
|
|
19
|
+
getNumberOfResults: vi.fn()
|
|
20
|
+
};
|
|
21
|
+
const portalType = PortalType.MASTER;
|
|
22
|
+
const dependencyType = DependencyTypes.SEARCH;
|
|
23
|
+
const filterState = {};
|
|
24
|
+
this.dependencies = {
|
|
25
|
+
portalType,
|
|
26
|
+
sortingState,
|
|
27
|
+
seoInfoBase,
|
|
28
|
+
filterState,
|
|
29
|
+
applicationState,
|
|
30
|
+
dependencyType
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
get seoInfoBase() {
|
|
34
|
+
return this.dependencies.seoInfoBase;
|
|
35
|
+
}
|
|
36
|
+
get filterState() {
|
|
37
|
+
return this.dependencies.filterState;
|
|
38
|
+
}
|
|
39
|
+
get dependencyType() {
|
|
40
|
+
return this.dependencies.dependencyType;
|
|
41
|
+
}
|
|
42
|
+
setSortingState(option) {
|
|
43
|
+
this.dependencies.sortingState.getSelectedOption.mockImplementation(() => {
|
|
44
|
+
return option;
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
setRankedResultsCount(count) {
|
|
48
|
+
this.dependencies.applicationState.getRankedResultsCount.mockImplementation(() => {
|
|
49
|
+
return count;
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
setPageNumber(pageNumber) {
|
|
53
|
+
this.dependencies.applicationState.getPageNumber.mockImplementation(() => {
|
|
54
|
+
return pageNumber;
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
setNumberOfResults(count) {
|
|
58
|
+
this.dependencies.applicationState.getNumberOfResults.mockImplementation(() => {
|
|
59
|
+
return count;
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
setPortalType(portalType) {
|
|
63
|
+
this.dependencies.portalType = portalType;
|
|
64
|
+
}
|
|
65
|
+
setFilterKeyValues(filterKeyValues) {
|
|
66
|
+
const filterKeys = Array.from(filterKeyValues.keys());
|
|
67
|
+
this.dependencies.seoInfoBase.singleSelectionFor.mockImplementation((key) => {
|
|
68
|
+
if (filterKeys.includes(key)) {
|
|
69
|
+
return filterKeyValues.get(key).length === 1;
|
|
70
|
+
}
|
|
71
|
+
return false;
|
|
72
|
+
});
|
|
73
|
+
this.dependencies.seoInfoBase.selectionOnlyFor.mockImplementation((keys) => {
|
|
74
|
+
if (keys.every((key) => filterKeys.includes(key)) && filterKeys.every((filterKey) => keys.includes(filterKey)))
|
|
75
|
+
return true;
|
|
76
|
+
return false;
|
|
77
|
+
});
|
|
78
|
+
this.dependencies.seoInfoBase.getFilterOptionValueBy.mockImplementation((key) => {
|
|
79
|
+
const values = filterKeyValues.get(key);
|
|
80
|
+
if (!values || values.length === 0)
|
|
81
|
+
return null;
|
|
82
|
+
return values[0];
|
|
83
|
+
});
|
|
84
|
+
this.dependencies.seoInfoBase.getSelectionTypeCount.mockImplementation(() => {
|
|
85
|
+
return filterKeys.length;
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { DependencyTypes } from '@/enums/DependencyTypes';
|
|
2
|
+
import { IOrganisationsSitemapDependencies } from '@/organisations/types/IOrganisationsSitemapDependencies';
|
|
3
|
+
import { IRankingApiClient } from '@/sitemap-generator/IRankingApiClient';
|
|
4
|
+
import { PortalType } from '@studyportals/domain-client';
|
|
5
|
+
import { IOrganisation, IOrganisationsClient, ISearchApiClient } from 'sitemap-generator-seo';
|
|
6
|
+
export declare class SitemapDependencies {
|
|
7
|
+
readonly dependencies: IOrganisationsSitemapDependencies;
|
|
8
|
+
constructor();
|
|
9
|
+
get searchApiClient(): ISearchApiClient;
|
|
10
|
+
get organisationsClient(): IOrganisationsClient;
|
|
11
|
+
get rankingApiClient(): IRankingApiClient;
|
|
12
|
+
get dependencyType(): DependencyTypes;
|
|
13
|
+
get portalType(): PortalType;
|
|
14
|
+
setOrganisations(organisations: IOrganisation[]): void;
|
|
15
|
+
setRankedOrganisationCount(count: number): void;
|
|
16
|
+
setOrganisationCount(count: number): void;
|
|
17
|
+
setPortalType(portalType: PortalType): void;
|
|
18
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { DependencyTypes } from '@/enums/DependencyTypes';
|
|
2
|
+
import { PortalType } from '@studyportals/domain-client';
|
|
3
|
+
import { vi } from 'vitest';
|
|
4
|
+
export class SitemapDependencies {
|
|
5
|
+
dependencies;
|
|
6
|
+
constructor() {
|
|
7
|
+
const searchApiClient = {
|
|
8
|
+
getOrganisationIds: vi.fn(),
|
|
9
|
+
getCount: vi.fn()
|
|
10
|
+
};
|
|
11
|
+
const organisationsClient = {
|
|
12
|
+
getOrganisations: vi.fn()
|
|
13
|
+
};
|
|
14
|
+
const rankingApiClient = {
|
|
15
|
+
getRankedOrganisationCount: vi.fn()
|
|
16
|
+
};
|
|
17
|
+
const dependencyType = DependencyTypes.SITEMAP_GENERATOR;
|
|
18
|
+
this.dependencies = {
|
|
19
|
+
searchApiClient,
|
|
20
|
+
organisationsClient,
|
|
21
|
+
rankingApiClient,
|
|
22
|
+
dependencyType,
|
|
23
|
+
portalType: PortalType.MASTER
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
get searchApiClient() {
|
|
27
|
+
return this.dependencies.searchApiClient;
|
|
28
|
+
}
|
|
29
|
+
get organisationsClient() {
|
|
30
|
+
return this.dependencies.organisationsClient;
|
|
31
|
+
}
|
|
32
|
+
get rankingApiClient() {
|
|
33
|
+
return this.dependencies.rankingApiClient;
|
|
34
|
+
}
|
|
35
|
+
get dependencyType() {
|
|
36
|
+
return this.dependencies.dependencyType;
|
|
37
|
+
}
|
|
38
|
+
get portalType() {
|
|
39
|
+
return this.dependencies.portalType;
|
|
40
|
+
}
|
|
41
|
+
setOrganisations(organisations) {
|
|
42
|
+
this.dependencies.searchApiClient.getOrganisationIds.mockResolvedValue(organisations.map((org) => org.id));
|
|
43
|
+
this.dependencies.organisationsClient.getOrganisations.mockResolvedValue(organisations);
|
|
44
|
+
}
|
|
45
|
+
setRankedOrganisationCount(count) {
|
|
46
|
+
this.dependencies.rankingApiClient.getRankedOrganisationCount.mockResolvedValue(count);
|
|
47
|
+
}
|
|
48
|
+
setOrganisationCount(count) {
|
|
49
|
+
this.dependencies.searchApiClient.getCount.mockResolvedValue(count);
|
|
50
|
+
}
|
|
51
|
+
setPortalType(portalType) {
|
|
52
|
+
this.dependencies.portalType = portalType;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
|
|
2
|
+
import { AreaPresenter } from '@/presenters/AreaPresenter';
|
|
3
|
+
import { FilterKey } from '@studyportals/search-filters/server-side';
|
|
4
|
+
describe('AreaPresenter', () => {
|
|
5
|
+
beforeEach(() => {
|
|
6
|
+
// Reset the singleton instance before each test
|
|
7
|
+
AreaPresenter.instance = undefined;
|
|
8
|
+
});
|
|
9
|
+
afterEach(() => {
|
|
10
|
+
vi.resetAllMocks();
|
|
11
|
+
});
|
|
12
|
+
it('Should be a singleton', () => {
|
|
13
|
+
const instance1 = AreaPresenter.getInstance();
|
|
14
|
+
const instance2 = AreaPresenter.getInstance();
|
|
15
|
+
expect(instance1).toBe(instance2);
|
|
16
|
+
});
|
|
17
|
+
it('Should have the correct filter key', () => {
|
|
18
|
+
const presenter = AreaPresenter.getInstance();
|
|
19
|
+
expect(presenter.filterKey).toBe(FilterKey.AREA);
|
|
20
|
+
});
|
|
21
|
+
it('Should return area fragments', () => {
|
|
22
|
+
const presenter = AreaPresenter.getInstance();
|
|
23
|
+
const fragments = presenter.getFragments();
|
|
24
|
+
expect(fragments.length).toBeGreaterThan(0);
|
|
25
|
+
// Check structure of fragments
|
|
26
|
+
const firstFragment = fragments[0];
|
|
27
|
+
expect(firstFragment).toHaveProperty('id');
|
|
28
|
+
expect(firstFragment).toHaveProperty('path');
|
|
29
|
+
expect(firstFragment).toHaveProperty('countryId');
|
|
30
|
+
// Verify that all fragments have the required properties
|
|
31
|
+
fragments.forEach((fragment) => {
|
|
32
|
+
expect(fragment).toHaveProperty('id');
|
|
33
|
+
expect(fragment).toHaveProperty('path');
|
|
34
|
+
expect(fragment).toHaveProperty('countryId');
|
|
35
|
+
expect(typeof fragment.id).toBe('string');
|
|
36
|
+
expect(typeof fragment.path).toBe('string');
|
|
37
|
+
expect(typeof fragment.countryId).toBe('string');
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
it('Should return the same fragments on multiple calls', () => {
|
|
41
|
+
const presenter = AreaPresenter.getInstance();
|
|
42
|
+
const fragments1 = presenter.getFragments();
|
|
43
|
+
const fragments2 = presenter.getFragments();
|
|
44
|
+
expect(fragments1).toBe(fragments2); // Should be the same instance
|
|
45
|
+
});
|
|
46
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { describe, it, expect, beforeEach } from 'vitest';
|
|
2
|
+
import { AttendancePresenter } from '@/presenters/AttendancePresenter';
|
|
3
|
+
import { FilterKey } from '@studyportals/search-filters/server-side';
|
|
4
|
+
describe('AttendancePresenter', () => {
|
|
5
|
+
beforeEach(() => {
|
|
6
|
+
// Reset the singleton instance before each test
|
|
7
|
+
AttendancePresenter.instance = undefined;
|
|
8
|
+
});
|
|
9
|
+
it('Should be a singleton', () => {
|
|
10
|
+
const instance1 = AttendancePresenter.getInstance();
|
|
11
|
+
const instance2 = AttendancePresenter.getInstance();
|
|
12
|
+
expect(instance1).toBe(instance2);
|
|
13
|
+
});
|
|
14
|
+
it('Should have the correct filter key', () => {
|
|
15
|
+
const presenter = AttendancePresenter.getInstance();
|
|
16
|
+
expect(presenter.filterKey).toBe(FilterKey.DELIVERY_METHOD);
|
|
17
|
+
});
|
|
18
|
+
it('Should return the correct fragments', () => {
|
|
19
|
+
const presenter = AttendancePresenter.getInstance();
|
|
20
|
+
const fragments = presenter.getFragments();
|
|
21
|
+
// Should have the online fragment
|
|
22
|
+
expect(fragments.length).toBeGreaterThan(0);
|
|
23
|
+
// Should have the online fragment
|
|
24
|
+
const onlineFragment = fragments.find((f) => f.id === 'online');
|
|
25
|
+
expect(onlineFragment).toBeDefined();
|
|
26
|
+
expect(onlineFragment?.path).toBe('online');
|
|
27
|
+
// Check structure of all fragments
|
|
28
|
+
fragments.forEach((fragment) => {
|
|
29
|
+
expect(fragment).toHaveProperty('id');
|
|
30
|
+
expect(fragment).toHaveProperty('path');
|
|
31
|
+
expect(typeof fragment.id).toBe('string');
|
|
32
|
+
expect(typeof fragment.path).toBe('string');
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
it('Should return the same fragments on multiple calls', () => {
|
|
36
|
+
const presenter = AttendancePresenter.getInstance();
|
|
37
|
+
const fragments1 = presenter.getFragments();
|
|
38
|
+
const fragments2 = presenter.getFragments();
|
|
39
|
+
expect(fragments1).toBe(fragments2); // Should be the same instance
|
|
40
|
+
});
|
|
41
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { describe, it, expect, beforeEach } from 'vitest';
|
|
2
|
+
import { ContinentPresenter } from '@/presenters/ContinentPresenter';
|
|
3
|
+
import { FilterKey } from '@studyportals/search-filters/server-side';
|
|
4
|
+
describe('ContinentPresenter', () => {
|
|
5
|
+
beforeEach(() => {
|
|
6
|
+
// Reset the singleton instance before each test
|
|
7
|
+
ContinentPresenter.instance = undefined;
|
|
8
|
+
});
|
|
9
|
+
it('Should be a singleton', () => {
|
|
10
|
+
const instance1 = ContinentPresenter.getInstance();
|
|
11
|
+
const instance2 = ContinentPresenter.getInstance();
|
|
12
|
+
expect(instance1).toBe(instance2);
|
|
13
|
+
});
|
|
14
|
+
it('Should have the correct filter key', () => {
|
|
15
|
+
const presenter = ContinentPresenter.getInstance();
|
|
16
|
+
expect(presenter.filterKey).toBe(FilterKey.CONTINENT);
|
|
17
|
+
});
|
|
18
|
+
it('Should return continent fragments', () => {
|
|
19
|
+
const presenter = ContinentPresenter.getInstance();
|
|
20
|
+
const fragments = presenter.getFragments();
|
|
21
|
+
// We expect to have at least a few continents
|
|
22
|
+
expect(fragments.length).toBeGreaterThan(0);
|
|
23
|
+
// Check structure of fragments
|
|
24
|
+
fragments.forEach((fragment) => {
|
|
25
|
+
expect(fragment).toHaveProperty('id');
|
|
26
|
+
expect(fragment).toHaveProperty('path');
|
|
27
|
+
expect(typeof fragment.id).toBe('string');
|
|
28
|
+
expect(typeof fragment.path).toBe('string');
|
|
29
|
+
});
|
|
30
|
+
// We should have common continents like Europe, Asia, etc.
|
|
31
|
+
const continentIds = fragments.map((f) => f.id);
|
|
32
|
+
const continentPaths = fragments.map((f) => f.path);
|
|
33
|
+
// We can't know the exact IDs, but we can check if some paths follow expected patterns
|
|
34
|
+
// Most continent paths should be lowercase and URL-friendly
|
|
35
|
+
const hasValidPaths = continentPaths.some((path) => /^[a-z-]+$/.test(path));
|
|
36
|
+
expect(hasValidPaths).toBe(true);
|
|
37
|
+
});
|
|
38
|
+
it('Should return the same fragments on multiple calls', () => {
|
|
39
|
+
const presenter = ContinentPresenter.getInstance();
|
|
40
|
+
const fragments1 = presenter.getFragments();
|
|
41
|
+
const fragments2 = presenter.getFragments();
|
|
42
|
+
expect(fragments1).toBe(fragments2); // Should be the same instance
|
|
43
|
+
});
|
|
44
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { describe, it, expect, beforeEach } from 'vitest';
|
|
2
|
+
import { CountryPresenter } from '@/presenters/CountryPresenter';
|
|
3
|
+
import { FilterKey } from '@studyportals/search-filters/server-side';
|
|
4
|
+
describe('CountryPresenter', () => {
|
|
5
|
+
beforeEach(() => {
|
|
6
|
+
// Reset the singleton instance before each test
|
|
7
|
+
CountryPresenter.instance = undefined;
|
|
8
|
+
});
|
|
9
|
+
it('Should be a singleton', () => {
|
|
10
|
+
const instance1 = CountryPresenter.getInstance();
|
|
11
|
+
const instance2 = CountryPresenter.getInstance();
|
|
12
|
+
expect(instance1).toBe(instance2);
|
|
13
|
+
});
|
|
14
|
+
it('Should have the correct filter key', () => {
|
|
15
|
+
const presenter = CountryPresenter.getInstance();
|
|
16
|
+
expect(presenter.filterKey).toBe(FilterKey.COUNTRY);
|
|
17
|
+
});
|
|
18
|
+
it('Should return country fragments', () => {
|
|
19
|
+
const presenter = CountryPresenter.getInstance();
|
|
20
|
+
const fragments = presenter.getFragments();
|
|
21
|
+
// Should have a good number of countries
|
|
22
|
+
expect(fragments.length).toBeGreaterThan(10);
|
|
23
|
+
// Check structure of country fragments
|
|
24
|
+
fragments.forEach((fragment) => {
|
|
25
|
+
expect(fragment).toHaveProperty('id');
|
|
26
|
+
expect(fragment).toHaveProperty('path');
|
|
27
|
+
expect(fragment).toHaveProperty('iso');
|
|
28
|
+
expect(typeof fragment.id).toBe('string');
|
|
29
|
+
expect(typeof fragment.path).toBe('string');
|
|
30
|
+
expect(typeof fragment.iso).toBe('string');
|
|
31
|
+
});
|
|
32
|
+
// We should be able to find common countries
|
|
33
|
+
const commonCountryIds = ['30', '56', '82', '21']; // UK, US, Netherlands, Portugal
|
|
34
|
+
const foundCountryIds = fragments.map((f) => f.id);
|
|
35
|
+
// Check if at least some of these common countries are present
|
|
36
|
+
const hasCommonCountries = commonCountryIds.some((id) => foundCountryIds.includes(id));
|
|
37
|
+
expect(hasCommonCountries).toBe(true);
|
|
38
|
+
// Some known paths should exist
|
|
39
|
+
const paths = fragments.map((f) => f.path);
|
|
40
|
+
const expectedPaths = ['uk', 'usa', 'netherlands', 'portugal', 'germany', 'france'];
|
|
41
|
+
const hasExpectedPaths = expectedPaths.some((path) => paths.includes(path));
|
|
42
|
+
expect(hasExpectedPaths).toBe(true);
|
|
43
|
+
});
|
|
44
|
+
it('Should return the same fragments on multiple calls', () => {
|
|
45
|
+
const presenter = CountryPresenter.getInstance();
|
|
46
|
+
const fragments1 = presenter.getFragments();
|
|
47
|
+
const fragments2 = presenter.getFragments();
|
|
48
|
+
expect(fragments1).toBe(fragments2); // Should be the same instance
|
|
49
|
+
});
|
|
50
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|