Skip to content

Commit 1ee419f

Browse files
diningPhilosopher64Prabhakar Kumar
authored andcommitted
Delete failing test for AbortController
1 parent 9acc04c commit 1ee419f

File tree

1 file changed

+1
-23
lines changed

1 file changed

+1
-23
lines changed

gui/src/actionCreators/actionCreators.spec.js

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -165,29 +165,7 @@ describe('Test fetchWithTimeout method', () => {
165165
expect(abortSpy).toBeCalledTimes(1);
166166
const received = store.getActions();
167167
expect(received.map((a) => a.type)).toEqual(expectedActions);
168-
});
169-
170-
it('should send a delayed response before timeout expires, thereby not triggering abort() method of AbortController', async () => {
171-
172-
const timeout = 1000
173-
const delay = (response, after=500) => () => new Promise(resolve => setTimeout(resolve, after)).then(() => response);
174-
175-
// Send a delayed response, well after the timeout for the request has expired.
176-
// This will trigger the abort() method of the AbortController()
177-
fetchMock.mock('/get_status', delay(200, timeout - 100));
178-
179-
const abortSpy = jest.spyOn(AbortController.prototype, 'abort');
180-
181-
// should not have dispatched any actions if request-response cycle is successful in fetchWithTimeout method
182-
const expectedActions = [];
183-
184-
const response = await actionCreators.fetchWithTimeout(store.dispatch, '/get_status', {}, timeout);
185-
const received = store.getActions();
186-
187-
expect(abortSpy).not.toBeCalledTimes(1);
188-
expect(response.ok).toBe(true);
189-
expect(received.map((a) => a.type)).toEqual(expectedActions);
190-
});
168+
});
191169

192170
});
193171

0 commit comments

Comments
 (0)