From 2d794041b7ab2a2dbff10a237260892ee0617b2c Mon Sep 17 00:00:00 2001 From: Ignacio Rivas Date: Wed, 6 Oct 2021 16:40:03 +0200 Subject: [PATCH] Add better docs --- .../overview/fix_logs_step/fix_logs_step.test.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/x-pack/plugins/upgrade_assistant/__jest__/client_integration/overview/fix_logs_step/fix_logs_step.test.tsx b/x-pack/plugins/upgrade_assistant/__jest__/client_integration/overview/fix_logs_step/fix_logs_step.test.tsx index 10a098240f42a..7d4b6b8518dff 100644 --- a/x-pack/plugins/upgrade_assistant/__jest__/client_integration/overview/fix_logs_step/fix_logs_step.test.tsx +++ b/x-pack/plugins/upgrade_assistant/__jest__/client_integration/overview/fix_logs_step/fix_logs_step.test.tsx @@ -346,6 +346,7 @@ describe('Overview - Fix deprecation logs step', () => { }; httpRequestsMockHelpers.setDeleteLogsCacheResponse(undefined, error); + // Initially we want to have the callout to have a warning state httpRequestsMockHelpers.setLoadDeprecationLogsCountResponse({ count: 10 }); const addDanger = jest.fn(); @@ -373,9 +374,9 @@ describe('Overview - Fix deprecation logs step', () => { // The toast should always be shown if the delete logs cache fails. expect(addDanger).toHaveBeenCalled(); - // Even though a stub for the API call getting the count was set to return 0, - // given that the delete logs cache API call will fail the callout remains in - // warning state. + // Even though we changed the response of the getLogsCountResponse, when the + // deleteLogsCache fails the getLogsCount api should not be called and the + // status of the callout should remain the same it initially was. expect(exists('hasWarningsCallout')).toBe(true); });