Skip to content

Commit

Permalink
Test when count api fails
Browse files Browse the repository at this point in the history
  • Loading branch information
sabarasaba committed Sep 9, 2021
1 parent 2dbd243 commit 674d96e
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -307,15 +307,18 @@ describe('Overview - Fix deprecation logs step', () => {
jest.useRealTimers();
});

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

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

// second request should make it incomplete
httpRequestsMockHelpers.setLoadDeprecationLogsCountResponse({
count: 5,
});
// second request will error
const error = {
statusCode: 500,
error: 'Internal server error',
message: 'Internal server error',
};
httpRequestsMockHelpers.setLoadDeprecationLogsCountResponse(undefined, error);

// Resolve the polling timeout.
await advanceTime(DEPRECATION_LOGS_COUNT_POLL_INTERVAL_MS);
Expand Down

0 comments on commit 674d96e

Please sign in to comment.