Skip to content
This repository has been archived by the owner on Aug 9, 2022. It is now read-only.

Connect Report Details Backend #52

Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ exports[`<ReportDetails /> panel render component 1`] = `
>
<h2
class="euiTitle euiTitle--medium"
>
Daily Sales Report-232o2jsf28492h3rjskfbwjk23
</h2>
/>
</div>
</div>
<div
Expand Down Expand Up @@ -137,9 +135,7 @@ exports[`<ReportDetails /> panel render component 1`] = `
</dt>
<dd
class="euiDescriptionList__description"
>
Daily Sales Report-232o2jsf28492h3rjskfbwjk23
</dd>
/>
</dl>
</div>
<div
Expand All @@ -155,9 +151,7 @@ exports[`<ReportDetails /> panel render component 1`] = `
</dt>
<dd
class="euiDescriptionList__description"
>
Report Description Here
</dd>
/>
</dl>
</div>
<div
Expand All @@ -173,9 +167,7 @@ exports[`<ReportDetails /> panel render component 1`] = `
</dt>
<dd
class="euiDescriptionList__description"
>
Mon Apr 20 2020 20:32:12 GMT-0700 (Pacific Daylight Time)
</dd>
/>
</dl>
</div>
<div
Expand All @@ -191,9 +183,7 @@ exports[`<ReportDetails /> panel render component 1`] = `
</dt>
<dd
class="euiDescriptionList__description"
>
Mon Apr 20 2020 20:32:12 GMT-0700 (Pacific Daylight Time)
</dd>
/>
</dl>
</div>
</div>
Expand All @@ -216,9 +206,7 @@ exports[`<ReportDetails /> panel render component 1`] = `
</dt>
<dd
class="euiDescriptionList__description"
>
Download
</dd>
/>
</dl>
</div>
<div
Expand All @@ -234,9 +222,7 @@ exports[`<ReportDetails /> panel render component 1`] = `
</dt>
<dd
class="euiDescriptionList__description"
>
dashboard/daily_sales
</dd>
/>
</dl>
</div>
<div
Expand All @@ -252,9 +238,7 @@ exports[`<ReportDetails /> panel render component 1`] = `
</dt>
<dd
class="euiDescriptionList__description"
>
PDF
</dd>
/>
</dl>
</div>
<div
Expand Down Expand Up @@ -291,9 +275,7 @@ exports[`<ReportDetails /> panel render component 1`] = `
</dt>
<dd
class="euiDescriptionList__description"
>
--
</dd>
/>
</dl>
</div>
<div
Expand All @@ -309,9 +291,7 @@ exports[`<ReportDetails /> panel render component 1`] = `
</dt>
<dd
class="euiDescriptionList__description"
>
--
</dd>
/>
</dl>
</div>
<div
Expand Down Expand Up @@ -370,9 +350,7 @@ exports[`<ReportDetails /> panel render component 1`] = `
</dt>
<dd
class="euiDescriptionList__description"
>
Schedule
</dd>
/>
</dl>
</div>
<div
Expand All @@ -388,9 +366,7 @@ exports[`<ReportDetails /> panel render component 1`] = `
</dt>
<dd
class="euiDescriptionList__description"
>
Now
</dd>
/>
</dl>
</div>
<div
Expand All @@ -406,9 +382,7 @@ exports[`<ReportDetails /> panel render component 1`] = `
</dt>
<dd
class="euiDescriptionList__description"
>
--
</dd>
/>
</dl>
</div>
<div
Expand All @@ -424,9 +398,7 @@ exports[`<ReportDetails /> panel render component 1`] = `
</dt>
<dd
class="euiDescriptionList__description"
>
--
</dd>
/>
</dl>
</div>
</div>
Expand Down Expand Up @@ -457,9 +429,7 @@ exports[`<ReportDetails /> panel render component 1`] = `
</dt>
<dd
class="euiDescriptionList__description"
>
Kibana Reports
</dd>
/>
</dl>
</div>
<div
Expand All @@ -475,9 +445,7 @@ exports[`<ReportDetails /> panel render component 1`] = `
</dt>
<dd
class="euiDescriptionList__description"
>
admin
</dd>
/>
</dl>
</div>
<div
Expand All @@ -493,9 +461,7 @@ exports[`<ReportDetails /> panel render component 1`] = `
</dt>
<dd
class="euiDescriptionList__description"
>
--
</dd>
/>
</dl>
</div>
<div
Expand All @@ -511,9 +477,7 @@ exports[`<ReportDetails /> panel render component 1`] = `
</dt>
<dd
class="euiDescriptionList__description"
>
--
</dd>
/>
</dl>
</div>
</div>
Expand All @@ -536,9 +500,7 @@ exports[`<ReportDetails /> panel render component 1`] = `
</dt>
<dd
class="euiDescriptionList__description"
>
--
</dd>
/>
</dl>
</div>
<div
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,41 +16,26 @@
import React from 'react';
import { render } from '@testing-library/react';
import { ReportDetails } from '../report_details';
import propsMock from '../../../../../test/propsMock';
import httpClientMock from '../../../../../test/httpMockClient';
import 'babel-polyfill';

describe('<ReportDetails /> panel', () => {
const created_date = new Date('April 20, 2020 20:32:12');

// since props is currently empty, snapshot test depends on const supplied from report_details.tsx
// will be fixed after front-end connected w/ back-end and props is defined
const reportDetailsMockMetadata = {
report_name: 'Daily Sales Report-232o2jsf28492h3rjskfbwjk23',
description: 'Report Description Here',
created: created_date.toString(),
last_updated: created_date.toString(),
source_type: 'Download',
source: 'dashboard/daily_sales',
default_file_format: 'PDF',
report_header: '--',
report_footer: '--',
report_type: 'Schedule',
schedule_type: 'Now',
schedule_details: '--',
alert_details: '--',
channel: 'Kibana Reports',
kibana_recipients: 'admin',
email_recipients: '--',
email_subject: '--',
email_body: '--',
report_as_attachment: false,
const match = {
params: {
reportId: '1',
},
};

test('render component', () => {
const { container } = render(
test('render component', async (done) => {
const { container } = await render(
<ReportDetails
reportId={'1'}
reportDetailsMetadata={reportDetailsMockMetadata}
httpClient={httpClientMock}
props={propsMock}
match={match}
/>
);
expect(container.firstChild).toMatchSnapshot();
await expect(container.firstChild).toMatchSnapshot();
done();
});
});
Loading