Commit 9c06ba9b authored by Robert Knight's avatar Robert Knight

Fix a test that did not execute intended code path

The customized result for the first stub call was not used because a
more specific response was defined earlier using `withArgs`.
parent ffa9de55
......@@ -83,13 +83,18 @@ describe('APIRoutesService', () => {
);
});
it('retries the route fetch until it succeeds', () => {
window.fetch.onFirstCall().returns(httpResponse(500, null));
return apiRoutes.routes().then(routes => {
it('retries the route fetch until it succeeds', async () => {
window.fetch
.withArgs('https://annotation.service/api/')
.onFirstCall()
.returns(httpResponse(500, null));
const routes = await apiRoutes.routes();
assert.calledTwice(window.fetch);
assert.deepEqual(routes, apiIndexResponse.links);
});
});
});
describe('#links', () => {
it('returns page links', () => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment