Skip to content

Commit 674d96e

Browse files
committed
Test when count api fails
1 parent 2dbd243 commit 674d96e

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

x-pack/plugins/upgrade_assistant/__jest__/client_integration/overview/fix_logs_step/fix_logs_step.test.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -307,15 +307,18 @@ describe('Overview - Fix deprecation logs step', () => {
307307
jest.useRealTimers();
308308
});
309309

310-
test('renders step as incomplete when having no deprecation logs but after some time we have some', async () => {
310+
test('renders step as incomplete when a success state is followed by an error state', async () => {
311311
const { exists } = testBed;
312312

313313
expect(exists('fixLogsStep-complete')).toBe(true);
314314

315-
// second request should make it incomplete
316-
httpRequestsMockHelpers.setLoadDeprecationLogsCountResponse({
317-
count: 5,
318-
});
315+
// second request will error
316+
const error = {
317+
statusCode: 500,
318+
error: 'Internal server error',
319+
message: 'Internal server error',
320+
};
321+
httpRequestsMockHelpers.setLoadDeprecationLogsCountResponse(undefined, error);
319322

320323
// Resolve the polling timeout.
321324
await advanceTime(DEPRECATION_LOGS_COUNT_POLL_INTERVAL_MS);

0 commit comments

Comments
 (0)