Skip to content

Commit d12caa5

Browse files
author
N. Taylor Mullen
committed
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
1 parent e7a1dc6 commit d12caa5

File tree

1 file changed

+17
-18
lines changed

1 file changed

+17
-18
lines changed

src/Components/Web.JS/tests/DefaultReconnectionHandler.test.ts

+17-18
Original file line numberDiff line numberDiff line change
@@ -58,24 +58,23 @@ describe('DefaultReconnectionHandler', () => {
5858
expect(reconnect).toHaveBeenCalledTimes(1);
5959
});
6060

61-
// Skipped while under investigation: https://github.com/aspnet/AspNetCore/issues/12578
62-
// it('invokes failed if reconnect fails', async () => {
63-
// const testDisplay = createTestDisplay();
64-
// const reconnect = jest.fn().mockRejectedValue(null);
65-
// const handler = new DefaultReconnectionHandler(NullLogger.instance, testDisplay, reconnect);
66-
// window.console.error = jest.fn();
67-
68-
// handler.onConnectionDown({
69-
// maxRetries: 3,
70-
// retryIntervalMilliseconds: 20,
71-
// dialogId: 'ignored'
72-
// });
73-
74-
// await delay(500);
75-
// expect(testDisplay.show).toHaveBeenCalled();
76-
// expect(testDisplay.failed).toHaveBeenCalled();
77-
// expect(reconnect).toHaveBeenCalledTimes(3);
78-
// });
61+
it('invokes failed if reconnect fails', async () => {
62+
const testDisplay = createTestDisplay();
63+
const reconnect = jest.fn().mockRejectedValue(null);
64+
const handler = new DefaultReconnectionHandler(NullLogger.instance, testDisplay, reconnect);
65+
window.console.error = jest.fn();
66+
67+
handler.onConnectionDown({
68+
maxRetries: 2,
69+
retryIntervalMilliseconds: 5,
70+
dialogId: 'ignored'
71+
});
72+
73+
await delay(500);
74+
expect(testDisplay.show).toHaveBeenCalled();
75+
expect(testDisplay.failed).toHaveBeenCalled();
76+
expect(reconnect).toHaveBeenCalledTimes(2);
77+
});
7978
});
8079

8180
function attachUserSpecifiedUI(options: ReconnectionOptions): Element {

0 commit comments

Comments
 (0)