Re-enable reconnection failed invocation validation test.

- Relaxed the `maxRetries` and `retryIntervalMilliseconds` parameters to enable the test to complete quicker. Couldn't reproduce a failure even as the test is originally on my own Mac.

#12578
This commit is contained in:
N. Taylor Mullen 2019-08-13 15:42:19 -07:00
parent c605d6cf63
commit e5a950de97
1 changed files with 15 additions and 16 deletions

View File

@ -58,24 +58,23 @@ describe('DefaultReconnectionHandler', () => {
expect(reconnect).toHaveBeenCalledTimes(1); expect(reconnect).toHaveBeenCalledTimes(1);
}); });
// Skipped while under investigation: https://github.com/aspnet/AspNetCore/issues/12578 it('invokes failed if reconnect fails', async () => {
// it('invokes failed if reconnect fails', async () => { const testDisplay = createTestDisplay();
// const testDisplay = createTestDisplay(); const reconnect = jest.fn().mockRejectedValue(null);
// const reconnect = jest.fn().mockRejectedValue(null); const handler = new DefaultReconnectionHandler(NullLogger.instance, testDisplay, reconnect);
// const handler = new DefaultReconnectionHandler(NullLogger.instance, testDisplay, reconnect); window.console.error = jest.fn();
// window.console.error = jest.fn();
// handler.onConnectionDown({ handler.onConnectionDown({
// maxRetries: 3, maxRetries: 2,
// retryIntervalMilliseconds: 20, retryIntervalMilliseconds: 5,
// dialogId: 'ignored' dialogId: 'ignored'
// }); });
// await delay(500); await delay(500);
// expect(testDisplay.show).toHaveBeenCalled(); expect(testDisplay.show).toHaveBeenCalled();
// expect(testDisplay.failed).toHaveBeenCalled(); expect(testDisplay.failed).toHaveBeenCalled();
// expect(reconnect).toHaveBeenCalledTimes(3); expect(reconnect).toHaveBeenCalledTimes(2);
// }); });
}); });
function attachUserSpecifiedUI(options: ReconnectionOptions): Element { function attachUserSpecifiedUI(options: ReconnectionOptions): Element {