Skip to content

Commit eebcc57

Browse files
authored
immoscout: opt into tenant-network pool via &tenantNetwork=true (#410)
1 parent 849362a commit eebcc57

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

lib/services/immoscout/immoscout-web-translator.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ const PARAM_NAME_MAP = {
8989
sorting: 'sorting',
9090
newbuilding: 'newbuilding',
9191
fulltext: 'fulltext',
92+
tenantNetwork: 'tenantNetwork',
9293
};
9394

9495
const EQUIPMENT_MAP = {

test/services/immoscout/immoscout-web-translator.test.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,16 @@ describe('#immoscout-mobile URL conversion', () => {
210210
expect(queryParams.get('apartmenttypes')).toBe(apartmentType);
211211
});
212212

213+
// The tenantNetwork flag opts into the mobile API's "Mieter-Netzwerk" pool.
214+
it('should forward the tenantNetwork flag when present in the web URL', () => {
215+
const webUrl =
216+
'https://www.immobilienscout24.de/Suche/de/nordrhein-westfalen/neuss-rhein-kreis/rommerskirchen/wohnung-mieten?enteredFrom=result_list&tenantNetwork=true';
217+
218+
const converted = convertWebToMobile(webUrl);
219+
const queryParams = new URL(converted).searchParams;
220+
expect(queryParams.get('tenantNetwork')).toBe('true');
221+
});
222+
213223
// Test URL conversion with unsupported query parameters
214224
it('should remove unsupported query parameters', () => {
215225
const webUrl = 'https://www.immobilienscout24.de/Suche/de/berlin/berlin/wohnung-mieten?minimuminternetspeed=100000';

0 commit comments

Comments
 (0)