mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-12 16:52:50 +00:00
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user