ImmoScout: Allow web paths with SEO optimization to be filtered to query params (#128)

This commit is contained in:
Leon C.
2025-05-20 12:44:43 +02:00
committed by GitHub
parent f4c2130829
commit 1f54bcfd3f
2 changed files with 48 additions and 3 deletions

View File

@@ -16,6 +16,16 @@ describe('#immoscout-mobile URL conversion', () => {
expect(actualMobileUrl).to.equal(expectedMobileUrl);
});
// Test URL conversion of web-only SEO path
it('should convert a SEO web path to the correct query params', () => {
const webUrl =
'https://www.immobilienscout24.de/Suche/de/berlin/berlin/wohnung-mit-balkon-mieten?equipment=garden';
const converted = convertWebToMobile(webUrl);
const queryParams = new URL(converted).searchParams;
expect(queryParams.get('equipment').split(',')).to.include.members(['garden', 'balcony']);
});
// Test URL conversion with unsupported query parameters
it('should remove unsupported query parameters', () => {
const webUrl = 'https://www.immobilienscout24.de/Suche/de/berlin/berlin/wohnung-mieten?minimuminternetspeed=100000';