From a33c340356e7b1420331b08afea5ab800b496d76 Mon Sep 17 00:00:00 2001 From: Martin Raifer Date: Tue, 11 Mar 2025 16:00:09 +0100 Subject: [PATCH] adjust tests for new rate limit handling see 91aa85a1c --- test/spec/services/osm.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/spec/services/osm.js b/test/spec/services/osm.js index d4e1dedc8..2e6d5120d 100644 --- a/test/spec/services/osm.js +++ b/test/spec/services/osm.js @@ -164,7 +164,7 @@ describe('iD.serviceOsm', function () { }); it('dispatches change event if 509 Bandwidth Limit Exceeded', async () => { - fetchMock.mock('https://www.openstreetmap.org' + path, { + fetchMock.mock(`https://www.openstreetmap.org${path}?bbox=`, { body: 'Bandwidth Limit Exceeded', status: 509, headers: { 'Content-Type': 'text/plain' } @@ -172,7 +172,7 @@ describe('iD.serviceOsm', function () { logout(); connection.on('change', spy); - const promise = promisify(connection.loadFromAPI).call(connection, path); + const promise = promisify(connection.loadTile).call(connection, { id: '0', extent: { toParam: () => '', bbox: () => ({}) } }); await expect(promise).rejects.toThrow(expect.objectContaining({ status: 509 })); @@ -180,7 +180,7 @@ describe('iD.serviceOsm', function () { }); it('dispatches change event if 429 Too Many Requests', async () => { - fetchMock.mock('https://www.openstreetmap.org' + path, { + fetchMock.mock(`https://www.openstreetmap.org${path}?bbox=`, { body: '429 Too Many Requests', status: 429, headers: { 'Content-Type': 'text/plain' } @@ -188,7 +188,7 @@ describe('iD.serviceOsm', function () { logout(); connection.on('change', spy); - const promise = promisify(connection.loadFromAPI).call(connection, path); + const promise = promisify(connection.loadTile).call(connection, { id: '0', extent: { toParam: () => '', bbox: () => ({}) } }); await expect(promise).rejects.toThrow(expect.objectContaining({ status: 429 })); expect(spy).to.have.been.calledOnce;