From 52b44ae711031e1aac7e55cbf230f1e8ddaaac43 Mon Sep 17 00:00:00 2001 From: Saanica Ghate Date: Thu, 25 Jan 2024 16:09:16 +0530 Subject: [PATCH 01/32] Enzyme replacement done for 4 files. --- .../__snapshots__/outcome-chip.test.tsx.snap | 250 +++++--- .../outcome-icon-set.test.tsx.snap | 590 +++++++++++++----- .../__snapshots__/outcome-icon.test.tsx.snap | 324 ++++++---- .../outcome-summary-bar.test.tsx.snap | 509 +++++++++------ .../reports/components/outcome-chip.test.tsx | 18 +- .../components/outcome-icon-set.test.tsx | 14 +- .../reports/components/outcome-icon.test.tsx | 10 +- .../components/outcome-summary-bar.test.tsx | 18 +- 8 files changed, 1170 insertions(+), 563 deletions(-) diff --git a/src/tests/unit/tests/reports/components/__snapshots__/outcome-chip.test.tsx.snap b/src/tests/unit/tests/reports/components/__snapshots__/outcome-chip.test.tsx.snap index 6b3933a636f..9ed628e76a3 100644 --- a/src/tests/unit/tests/reports/components/__snapshots__/outcome-chip.test.tsx.snap +++ b/src/tests/unit/tests/reports/components/__snapshots__/outcome-chip.test.tsx.snap @@ -1,113 +1,187 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`OutcomeChip render fail 1`] = ` - + - + + + + + + + + 4 Failed + - - - 4 Failed - - + `; exports[`OutcomeChip render inapplicable 1`] = ` - - - - - + - 4 Not applicable + + + + + + + + 4 Not applicable + - + `; exports[`OutcomeChip render incomplete 1`] = ` - + - + + + + + + 2 Incomplete + - - - 2 Incomplete - - + `; exports[`OutcomeChip render pass 1`] = ` - - - - - + - 3 Passed + + + + + + + + 3 Passed + - + `; diff --git a/src/tests/unit/tests/reports/components/__snapshots__/outcome-icon-set.test.tsx.snap b/src/tests/unit/tests/reports/components/__snapshots__/outcome-icon-set.test.tsx.snap index 7086bab1f6b..7582dc35de9 100644 --- a/src/tests/unit/tests/reports/components/__snapshots__/outcome-icon-set.test.tsx.snap +++ b/src/tests/unit/tests/reports/components/__snapshots__/outcome-icon-set.test.tsx.snap @@ -1,152 +1,464 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`OutcomeIconSet render render all zero 1`] = ` -
- +
- 0 Passed, 0 Incomplete, 0 Failed - -
+ + 0 Passed, 0 Incomplete, 0 Failed + +
+ `; exports[`OutcomeIconSet render render incomplete zero 1`] = ` -
- +
- - - - - - - - - - - - - - - - - - - - - - 3 Passed, 0 Incomplete, 4 Failed - -
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 3 Passed, 0 Incomplete, 4 Failed + +
+ `; exports[`OutcomeIconSet render render with all properties 1`] = ` -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - +
- 3 Passed, 2 Incomplete, 4 Failed - -
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 3 Passed, 2 Incomplete, 4 Failed + +
+ `; diff --git a/src/tests/unit/tests/reports/components/__snapshots__/outcome-icon.test.tsx.snap b/src/tests/unit/tests/reports/components/__snapshots__/outcome-icon.test.tsx.snap index 5beab92cd66..65f6285e4ad 100644 --- a/src/tests/unit/tests/reports/components/__snapshots__/outcome-icon.test.tsx.snap +++ b/src/tests/unit/tests/reports/components/__snapshots__/outcome-icon.test.tsx.snap @@ -1,152 +1,226 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`CheckIcon render 1`] = ` - - - - - - + + + `; exports[`CheckIconInverted render 1`] = ` - - - - - + + + `; exports[`CircleIcon render 1`] = ` - + + + `; exports[`CrossIconInverted render 1`] = ` - - - - - + + + `; exports[`InapplicableIcon render 1`] = ` - - - - - - + + + `; exports[`InapplicableIconInverted render 1`] = ` - - - - - - + + + `; -exports[`OutcomeIcon render fail 1`] = ``; +exports[`OutcomeIcon render fail 1`] = ` + + + + + +`; -exports[`OutcomeIcon render incomplete 1`] = ``; +exports[`OutcomeIcon render incomplete 1`] = ` + + + +`; -exports[`OutcomeIcon render pass 1`] = ``; +exports[`OutcomeIcon render pass 1`] = ` + + + + + +`; diff --git a/src/tests/unit/tests/reports/components/__snapshots__/outcome-summary-bar.test.tsx.snap b/src/tests/unit/tests/reports/components/__snapshots__/outcome-summary-bar.test.tsx.snap index cf9e773131a..60f9437ec8a 100644 --- a/src/tests/unit/tests/reports/components/__snapshots__/outcome-summary-bar.test.tsx.snap +++ b/src/tests/unit/tests/reports/components/__snapshots__/outcome-summary-bar.test.tsx.snap @@ -1,227 +1,374 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`OutcomeSummaryBar render inverted badges 1`] = ` -
+ -
- + + + + 42 + +
+
- - 13 - -
-
- + + + + 13 + +
+
- - 7 - + + + 7 + +
- + `; exports[`OutcomeSummaryBar show by count 1`] = ` -
+ -
- + + + + 42 + +
+
- - 13 - -
-
- + + + + 13 + +
+
- - 7 - + + + 7 + +
- + `; exports[`OutcomeSummaryBar show by percentage 1`] = ` -
+ -
- + + + + 42% + +
+
- - 13 - % - -
-
- + + + + 13% + +
+
- - 7 - % - + + + 7% + +
- + `; exports[`OutcomeSummaryBar show with text label 1`] = ` -
+ -
- +
- - 13 - Failed + + + + 13 + + Failed + - -
-
- +
- - 7 - Incomplete + + 7 + + Incomplete + - +
-
+
`; diff --git a/src/tests/unit/tests/reports/components/outcome-chip.test.tsx b/src/tests/unit/tests/reports/components/outcome-chip.test.tsx index 02ab056592b..6183706b90a 100644 --- a/src/tests/unit/tests/reports/components/outcome-chip.test.tsx +++ b/src/tests/unit/tests/reports/components/outcome-chip.test.tsx @@ -1,29 +1,29 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -import { shallow } from 'enzyme'; +import { render } from '@testing-library/react'; import * as React from 'react'; import { OutcomeChip } from 'reports/components/outcome-chip'; describe('OutcomeChip', () => { describe('render', () => { test('pass', () => { - const wrapper = shallow(); - expect(wrapper.getElement()).toMatchSnapshot(); + const renderResult = render(); + expect(renderResult.asFragment()).toMatchSnapshot(); }); test('incomplete', () => { - const wrapper = shallow(); - expect(wrapper.getElement()).toMatchSnapshot(); + const renderResult = render(); + expect(renderResult.asFragment()).toMatchSnapshot(); }); test('fail', () => { - const wrapper = shallow(); - expect(wrapper.getElement()).toMatchSnapshot(); + const renderResult = render(); + expect(renderResult.asFragment()).toMatchSnapshot(); }); test('inapplicable', () => { - const wrapper = shallow(); - expect(wrapper.getElement()).toMatchSnapshot(); + const renderResult = render(); + expect(renderResult.asFragment()).toMatchSnapshot(); }); }); }); diff --git a/src/tests/unit/tests/reports/components/outcome-icon-set.test.tsx b/src/tests/unit/tests/reports/components/outcome-icon-set.test.tsx index de77c8c3041..71b5f6d4391 100644 --- a/src/tests/unit/tests/reports/components/outcome-icon-set.test.tsx +++ b/src/tests/unit/tests/reports/components/outcome-icon-set.test.tsx @@ -1,24 +1,24 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -import { shallow } from 'enzyme'; +import { render } from '@testing-library/react'; import * as React from 'react'; import { OutcomeIconSet } from 'reports/components/outcome-icon-set'; describe('OutcomeIconSet', () => { describe('render', () => { test('render with all properties', () => { - const wrapper = shallow(); - expect(wrapper.getElement()).toMatchSnapshot(); + const renderResult = render(); + expect(renderResult.asFragment()).toMatchSnapshot(); }); test('render incomplete zero', () => { - const wrapper = shallow(); - expect(wrapper.getElement()).toMatchSnapshot(); + const renderResult = render(); + expect(renderResult.asFragment()).toMatchSnapshot(); }); test('render all zero', () => { - const wrapper = shallow(); - expect(wrapper.getElement()).toMatchSnapshot(); + const renderResult = render(); + expect(renderResult.asFragment()).toMatchSnapshot(); }); }); }); diff --git a/src/tests/unit/tests/reports/components/outcome-icon.test.tsx b/src/tests/unit/tests/reports/components/outcome-icon.test.tsx index c940c216e5b..792428334bb 100644 --- a/src/tests/unit/tests/reports/components/outcome-icon.test.tsx +++ b/src/tests/unit/tests/reports/components/outcome-icon.test.tsx @@ -1,11 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +import { render } from '@testing-library/react'; import { CheckIcon, CheckIconInverted } from 'common/icons/check-icon'; import { CircleIcon } from 'common/icons/circle-icon'; import { CrossIconInverted } from 'common/icons/cross-icon'; import { InapplicableIcon, InapplicableIconInverted } from 'common/icons/inapplicable-icon'; -import { shallow } from 'enzyme'; import * as React from 'react'; import { OutcomeIcon } from 'reports/components/outcome-icon'; import { allRequirementOutcomeTypes } from 'reports/components/requirement-outcome-type'; @@ -14,8 +14,8 @@ describe('OutcomeIcon', () => { describe('render', () => { allRequirementOutcomeTypes.forEach(outcomeType => { test(outcomeType, () => { - const wrapper = shallow(); - expect(wrapper.getElement()).toMatchSnapshot(); + const renderResult = render(); + expect(renderResult.asFragment()).toMatchSnapshot(); }); }); }); @@ -32,8 +32,8 @@ describe('OutcomeIcon', () => { const name = Icon.displayName; describe(name, () => { test('render', () => { - const wrapper = shallow(); - expect(wrapper.getElement()).toMatchSnapshot(); + const renderResult = render(); + expect(renderResult.asFragment()).toMatchSnapshot(); }); }); }); diff --git a/src/tests/unit/tests/reports/components/outcome-summary-bar.test.tsx b/src/tests/unit/tests/reports/components/outcome-summary-bar.test.tsx index 78bd77d17da..57f9b082f34 100644 --- a/src/tests/unit/tests/reports/components/outcome-summary-bar.test.tsx +++ b/src/tests/unit/tests/reports/components/outcome-summary-bar.test.tsx @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -import { shallow } from 'enzyme'; +import { render } from '@testing-library/react'; import * as React from 'react'; import { OutcomeSummaryBar, OutcomeSummaryBarProps } from 'reports/components/outcome-summary-bar'; import { OutcomeType } from 'reports/components/outcome-type'; @@ -15,16 +15,16 @@ describe('OutcomeSummaryBar', () => { it('show by percentage', () => { const props: OutcomeSummaryBarProps = { outcomeStats, allOutcomeTypes, countSuffix: '%' }; - const wrapper = shallow(); + const renderResult = render(); - expect(wrapper.getElement()).toMatchSnapshot(); + expect(renderResult.asFragment()).toMatchSnapshot(); }); it('show by count', () => { const props: OutcomeSummaryBarProps = { outcomeStats, allOutcomeTypes }; - const wrapper = shallow(); + const renderResult = render(); - expect(wrapper.getElement()).toMatchSnapshot(); + expect(renderResult.asFragment()).toMatchSnapshot(); }); it('render inverted badges', () => { @@ -33,15 +33,15 @@ describe('OutcomeSummaryBar', () => { allOutcomeTypes, iconStyleInverted: true, }; - const wrapper = shallow(); + const renderResult = render(); - expect(wrapper.getElement()).toMatchSnapshot(); + expect(renderResult.asFragment()).toMatchSnapshot(); }); it('show with text label', () => { const props: OutcomeSummaryBarProps = { outcomeStats, allOutcomeTypes, textLabel: true }; - const wrapper = shallow(); + const renderResult = render(); - expect(wrapper.getElement()).toMatchSnapshot(); + expect(renderResult.asFragment()).toMatchSnapshot(); }); }); From 77b01796179e8dcc3ab61c569101efebbe7f001a Mon Sep 17 00:00:00 2001 From: Saanica Ghate Date: Mon, 5 Feb 2024 17:22:03 +0530 Subject: [PATCH 02/32] Enzyme replacement done. --- .../__snapshots__/report-head.test.tsx.snap | 76 +-- .../report-instance-list.test.tsx.snap | 460 +++++++++--------- .../summary-report-head.test.tsx.snap | 29 +- .../reports/components/report-head.test.tsx | 14 +- .../components/report-instance-list.test.tsx | 18 +- .../components/summary-report-head.test.tsx | 6 +- .../footer-text-for-service.test.tsx.snap | 32 +- .../package/footer-text-for-service.test.tsx | 6 +- .../content-include.test.tsx.snap | 20 +- .../content-panel-button.test.tsx.snap | 115 +++-- .../__snapshots__/content-view.test.tsx.snap | 47 +- .../views/content/content-include.test.tsx | 10 +- .../content/content-panel-button.test.tsx | 14 +- .../tests/views/content/content-view.test.tsx | 13 +- 14 files changed, 455 insertions(+), 405 deletions(-) diff --git a/src/tests/unit/tests/reports/components/__snapshots__/report-head.test.tsx.snap b/src/tests/unit/tests/reports/components/__snapshots__/report-head.test.tsx.snap index 7e400cdd75f..75059c32698 100644 --- a/src/tests/unit/tests/reports/components/__snapshots__/report-head.test.tsx.snap +++ b/src/tests/unit/tests/reports/components/__snapshots__/report-head.test.tsx.snap @@ -1,52 +1,52 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Head renders 1`] = ` - + - some title preface - - some title + some title preface some title - + + `; exports[`ReporterHead renders 1`] = ` ->", - } - } - title="automated checks result" - titlePreface="Accessibility Insights" -/> + + + + Accessibility Insights automated checks result + + + + `; exports[`WebReportHead renders 1`] = ` ->", - } - } - title="FastPass results" - titlePreface="Accessibility Insights for Web" -/> + + + + Accessibility Insights for Web FastPass results + + + + `; diff --git a/src/tests/unit/tests/reports/components/__snapshots__/report-instance-list.test.tsx.snap b/src/tests/unit/tests/reports/components/__snapshots__/report-instance-list.test.tsx.snap index 1c1025cd5ca..682b7a4f1e5 100644 --- a/src/tests/unit/tests/reports/components/__snapshots__/report-instance-list.test.tsx.snap +++ b/src/tests/unit/tests/reports/components/__snapshots__/report-instance-list.test.tsx.snap @@ -1,239 +1,247 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`ReportInstanceListTest render comment 1`] = ` -
- - - - - - - -
- Comment - - comment -
-
+ +
+ + + + + + + +
+ Comment + + comment +
+
+
`; exports[`ReportInstanceListTest render object prop value instance 1`] = ` -
- - - - - - - - - - -
- key1: -
- key1>1 - - value1>1 -
-
+ +
+ + + + + + + + + + +
+ key1: +
+ key1>1 + + value1>1 +
+
+
`; exports[`ReportInstanceListTest render simple rows first - property bag rows second 1`] = ` -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Complex Key One: -
- key1-1 - - value1-1 -
- key1-2 - - value1-2 -
- Simple Key One - - value1 -
- Complex Key Two: -
- key2-1 - - value2-1 -
- key2-2 - - value2-2 -
- Simple Key Two - - value2 -
- Sub Instance Value is null: -
- key2-1 - - - -
-
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Complex Key One: +
+ key1-1 + + value1-1 +
+ key1-2 + + value1-2 +
+ Simple Key One + + value1 +
+ Complex Key Two: +
+ key2-1 + + value2-1 +
+ key2-2 + + value2-2 +
+ Simple Key Two + + value2 +
+ Sub Instance Value is null: +
+ key2-1 + + - +
+
+
`; exports[`ReportInstanceListTest render snippet and path 1`] = ` -
- - - - - - - - - - - -
- Path - - target1 -
- Snippet - - someHtml -
-
+ +
+ + + + + + + + + + + +
+ Path + + target1 +
+ Snippet + + someHtml +
+
+
`; diff --git a/src/tests/unit/tests/reports/components/__snapshots__/summary-report-head.test.tsx.snap b/src/tests/unit/tests/reports/components/__snapshots__/summary-report-head.test.tsx.snap index 26b5169b571..d46df82b5dc 100644 --- a/src/tests/unit/tests/reports/components/__snapshots__/summary-report-head.test.tsx.snap +++ b/src/tests/unit/tests/reports/components/__snapshots__/summary-report-head.test.tsx.snap @@ -1,27 +1,18 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`SummaryReportHead renders 1`] = ` - + - Accessibility Insights - automated checks result + Accessibility Insights automated checks result - + + `; diff --git a/src/tests/unit/tests/reports/components/report-head.test.tsx b/src/tests/unit/tests/reports/components/report-head.test.tsx index 0b8db40b1af..b3f16c1b738 100644 --- a/src/tests/unit/tests/reports/components/report-head.test.tsx +++ b/src/tests/unit/tests/reports/components/report-head.test.tsx @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -import { shallow } from 'enzyme'; +import { render } from '@testing-library/react'; import * as React from 'react'; import { Head } from 'reports/components/head'; import { ReporterHead } from 'reports/components/reporter-automated-check-head'; @@ -8,15 +8,15 @@ import { WebReportHead } from 'reports/components/web-report-head'; describe('WebReportHead', () => { it('renders', () => { - const wrapper = shallow(); - expect(wrapper.getElement()).toMatchSnapshot(); + const renderResult = render(); + expect(renderResult.asFragment()).toMatchSnapshot(); }); }); describe('ReporterHead', () => { it('renders', () => { - const wrapper = shallow(); - expect(wrapper.getElement()).toMatchSnapshot(); + const renderResult = render(); + expect(renderResult.asFragment()).toMatchSnapshot(); }); }); @@ -25,13 +25,13 @@ describe('Head', () => { const styleSheetStub = { styleSheet: 'some style sheet', }; - const wrapper = shallow( + const renderResult = render( , ); - expect(wrapper.getElement()).toMatchSnapshot(); + expect(renderResult.asFragment()).toMatchSnapshot(); }); }); diff --git a/src/tests/unit/tests/reports/components/report-instance-list.test.tsx b/src/tests/unit/tests/reports/components/report-instance-list.test.tsx index 5b23fa2e1ad..3a0777ebfcb 100644 --- a/src/tests/unit/tests/reports/components/report-instance-list.test.tsx +++ b/src/tests/unit/tests/reports/components/report-instance-list.test.tsx @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -import { shallow } from 'enzyme'; +import { render } from '@testing-library/react'; import * as React from 'react'; import { ReportInstanceList } from 'reports/components/report-instance-list'; import { AssessmentReportBuilderTestHelper } from '../../DetailsView/assessment-report-builder-test-helper'; @@ -13,9 +13,9 @@ describe('ReportInstanceListTest', () => { AssessmentReportBuilderTestHelper.getInstanceReportModelStep1PassStep2Fail(), }; - const wrapper = shallow(); + const renderResult = render(); - expect(wrapper.getElement()).toMatchSnapshot(); + expect(renderResult.asFragment()).toMatchSnapshot(); }); test('comment', () => { @@ -24,9 +24,9 @@ describe('ReportInstanceListTest', () => { AssessmentReportBuilderTestHelper.getInstanceReportModelManualStep4Fail(), }; - const wrapper = shallow(); + const renderResult = render(); - expect(wrapper.getElement()).toMatchSnapshot(); + expect(renderResult.asFragment()).toMatchSnapshot(); }); test('object prop value instance', () => { @@ -34,9 +34,9 @@ describe('ReportInstanceListTest', () => { instances: AssessmentReportBuilderTestHelper.getInstanceWithObjectValueProp(), }; - const wrapper = shallow(); + const renderResult = render(); - expect(wrapper.getElement()).toMatchSnapshot(); + expect(renderResult.asFragment()).toMatchSnapshot(); }); test('simple rows first - property bag rows second', () => { @@ -45,9 +45,9 @@ describe('ReportInstanceListTest', () => { AssessmentReportBuilderTestHelper.getInstanceWithMixOfSimpleAndComplexValues(), }; - const wrapper = shallow(); + const renderResult = render(); - expect(wrapper.getElement()).toMatchSnapshot(); + expect(renderResult.asFragment()).toMatchSnapshot(); }); }); }); diff --git a/src/tests/unit/tests/reports/components/summary-report-head.test.tsx b/src/tests/unit/tests/reports/components/summary-report-head.test.tsx index ccc9899533e..91c9ee6f9a7 100644 --- a/src/tests/unit/tests/reports/components/summary-report-head.test.tsx +++ b/src/tests/unit/tests/reports/components/summary-report-head.test.tsx @@ -1,12 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -import { shallow } from 'enzyme'; +import { render } from '@testing-library/react'; import * as React from 'react'; import { SummaryReportHead } from 'reports/components/summary-report-head'; describe('SummaryReportHead', () => { it('renders', () => { - const wrapper = shallow(); - expect(wrapper.getElement()).toMatchSnapshot(); + const renderResult = render(); + expect(renderResult.asFragment()).toMatchSnapshot(); }); }); diff --git a/src/tests/unit/tests/reports/package/__snapshots__/footer-text-for-service.test.tsx.snap b/src/tests/unit/tests/reports/package/__snapshots__/footer-text-for-service.test.tsx.snap index a1c18ef2916..a6c17711a83 100644 --- a/src/tests/unit/tests/reports/package/__snapshots__/footer-text-for-service.test.tsx.snap +++ b/src/tests/unit/tests/reports/package/__snapshots__/footer-text-for-service.test.tsx.snap @@ -1,26 +1,16 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`FooterTextForService renders: footer 1`] = ` - - This automated checks result was generated using the - app-name - - that helps find some of the most common accessibility issues. The scan was - - performed in a clean browser environment, using - engine-name - - engine-version - and - environmentName - - with a display resolution of - 800x600 - . For a complete - - WCAG 2.1 compliance assessment please visit - - + + This automated checks result was generated using the app-name that helps find some of the most common accessibility issues. The scan was performed in a clean browser environment, using engine-name engine-version and environmentName with a display resolution of 800x600. For a complete WCAG 2.1 compliance assessment please visit + + http://aka.ms/AccessibilityInsights + . - + `; diff --git a/src/tests/unit/tests/reports/package/footer-text-for-service.test.tsx b/src/tests/unit/tests/reports/package/footer-text-for-service.test.tsx index c72e0bce43a..287eb751f5b 100644 --- a/src/tests/unit/tests/reports/package/footer-text-for-service.test.tsx +++ b/src/tests/unit/tests/reports/package/footer-text-for-service.test.tsx @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +import { render } from '@testing-library/react'; import { ScanMetadata, ToolData } from 'common/types/store-data/unified-data-interface'; -import { shallow } from 'enzyme'; import * as React from 'react'; import { FooterTextForService } from 'reports/package/footer-text-for-service'; @@ -24,7 +24,7 @@ describe('FooterTextForService', () => { } as ScanMetadata; - const footerWrapper = shallow(); - expect(footerWrapper.getElement()).toMatchSnapshot('footer'); + const renderResult = render(); + expect(renderResult.asFragment()).toMatchSnapshot('footer'); }); }); diff --git a/src/tests/unit/tests/views/content/__snapshots__/content-include.test.tsx.snap b/src/tests/unit/tests/views/content/__snapshots__/content-include.test.tsx.snap index e4b49c2f606..c29a3077313 100644 --- a/src/tests/unit/tests/views/content/__snapshots__/content-include.test.tsx.snap +++ b/src/tests/unit/tests/views/content/__snapshots__/content-include.test.tsx.snap @@ -1,13 +1,21 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`ContentInclude renders from content 1`] = ` -"
- -
" + +
+ CONTENT FOR TESTING +
+
`; exports[`ContentInclude renders from path 1`] = ` -"
- -
" + +
+ CONTENT FOR TESTING +
+
`; diff --git a/src/tests/unit/tests/views/content/__snapshots__/content-panel-button.test.tsx.snap b/src/tests/unit/tests/views/content/__snapshots__/content-panel-button.test.tsx.snap index d2073b30e38..486c083994a 100644 --- a/src/tests/unit/tests/views/content/__snapshots__/content-panel-button.test.tsx.snap +++ b/src/tests/unit/tests/views/content/__snapshots__/content-panel-button.test.tsx.snap @@ -1,43 +1,92 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`ContentPanelButton renders from content 1`] = ` - - TEXT - + +