From 8c2f3c6b98dac87da32030c6919920092666dd9e Mon Sep 17 00:00:00 2001 From: David Cui <53581635+davidcui-amzn@users.noreply.github.com> Date: Wed, 28 Oct 2020 10:17:32 -0700 Subject: [PATCH] fix warning on report details test (#156) --- .../report_details.test.tsx.snap | 56 ++++++++++++++----- .../__tests__/report_details.test.tsx | 19 +++++-- 2 files changed, 55 insertions(+), 20 deletions(-) diff --git a/kibana-reports/public/components/main/report_details/__tests__/__snapshots__/report_details.test.tsx.snap b/kibana-reports/public/components/main/report_details/__tests__/__snapshots__/report_details.test.tsx.snap index f4ee8715..e6a5e8c9 100644 --- a/kibana-reports/public/components/main/report_details/__tests__/__snapshots__/report_details.test.tsx.snap +++ b/kibana-reports/public/components/main/report_details/__tests__/__snapshots__/report_details.test.tsx.snap @@ -506,7 +506,9 @@ exports[` panel render on-demand component 1`] = ` >

+ > + test create report definition trigger +

@@ -538,7 +540,9 @@ exports[` panel render on-demand component 1`] = `
+ > + test create report definition trigger +
panel render on-demand component 1`] = `
+ > + — +
panel render on-demand component 1`] = `
+ > + — +
panel render on-demand component 1`] = `
+ > + — +
@@ -612,10 +622,12 @@ exports[` panel render on-demand component 1`] = ` > + > + Dashboard + @@ -632,7 +644,9 @@ exports[` panel render on-demand component 1`] = `
+ > + 10/23/2020, 1:53:35 PM -> 10/23/2020, 2:23:35 PM +
panel render on-demand component 1`] = `
+ > + On demand +
panel render on-demand component 1`] = `
+ > + — +
panel render on-demand component 1`] = `
+ > + — +
panel render on-demand component 1`] = `
+ > + — +
panel render on-demand component 1`] = `
+ > + — +
panel render on-demand component 1`] = `
+ > +

+ — +

+
panel', () => { const match = { params: { @@ -40,7 +44,7 @@ describe(' panel', () => { report_format: '', header: '', footer: '', - time_duration: '', + time_duration: 'PT30M', }, }, delivery: { @@ -54,17 +58,19 @@ describe(' panel', () => { httpClientMock.get = jest.fn().mockResolvedValue({ report_definition, + query_url: `http://localhost:5601/app/kibana#/dashboard/7adfa750-4c81-11e8-b3d7-01146121b73d?_g=(time:(from:'2020-10-23T20:53:35.315Z',to:'2020-10-23T21:23:35.316Z'))`, }); - const { container } = await render( + const { container } = render( ); - await expect(container.firstChild).toMatchSnapshot(); await act(() => promise); + await expect(container.firstChild).toMatchSnapshot(); }); test('render 5 hours recurring component', async () => { @@ -79,7 +85,7 @@ describe(' panel', () => { report_format: '', header: '', footer: '', - time_duration: '', + time_duration: 'PT30M', }, }, delivery: { @@ -108,14 +114,15 @@ describe(' panel', () => { query_url: `http://localhost:5601/app/kibana#/dashboard/7adfa750-4c81-11e8-b3d7-01146121b73d?_g=(time:(from:'2020-10-23T20:53:35.315Z',to:'2020-10-23T21:23:35.316Z'))`, }); - const { container } = await render( + const { container } = render( ); - await expect(container.firstChild).toMatchSnapshot(); await act(() => promise); + await expect(container.firstChild).toMatchSnapshot(); }); });