From 15c15077c18d2895630f1467371b1b6f9c221415 Mon Sep 17 00:00:00 2001 From: JeevaniChinthala <148259226+JeevaniChinthala@users.noreply.github.com> Date: Fri, 12 Apr 2024 00:27:49 +0530 Subject: [PATCH] chore: Typescript Cleanup- Part 3 for Test Files (#7291) #### Details As part of Typescript migration added/removed the error causing fields. ##### Motivation TypeScript 5.0 has marked some options as deprecated. We can temporarily override these deprecations, but the documented plan is for the ability to override the flag to go away in TypeScript 5.5 ##### Context 1. **featureFlagStoreData** - **Error:** Type '{ backLinkHandler: () => void; diagnosticViewToggleFactory: DiagnosticViewToggleFactory; featureFlagStoreData: FeatureFlagStoreData; }' is not assignable to type 'IntrinsicAttributes & AdHocToolsPanelProps & { children?: ReactNode; }'. Property 'featureFlagStoreData' does not exist on type 'IntrinsicAttributes & AdHocToolsPanelProps & { children?: ReactNode; }'. 2. **avatarUrl: 'avatarUrl'** - **Error:** Type '{ featureFlagStoreData: { 'test-flag': true; }; avatarUrl: string; tabClosed: boolean; deps: InteractiveHeaderDeps; selectedPivot: DetailsViewPivotType.assessment; navMenu: ReactFCWithDisplayName<...>; narrowModeStatus: NarrowModeStatus; isSideNavOpen: false; setSideNavOpen: null; }' is not assignable to type 'InteractiveHeaderProps'. - Object literal may only specify known properties, and 'avatarUrl' does not exist in type 'InteractiveHeaderProps'. 3. **status: ManualTestStatus.FAIL** - **Error:** Type '{ step: string; test: VisualizationType.HeadingsAssessment; status: ManualTestStatus; assessmentInstanceTableHandler: AssessmentInstanceTableHandler; manualTestStepResultMap: { ...; }; assessmentsProvider: AssessmentsProvider; featureFlagStoreData: FeatureFlagStoreData; pathSnippetStoreData: { ...; }; }' is not assignable to type 'ManualTestStepViewProps'. - Object literal may only specify known properties, and 'status' does not exist in type 'ManualTestStepViewProps'. 4. **supportLinkHandler: null** - **Error:** Type '{ deps: LaunchPanelHeaderDeps; title: string; subtitle: string; supportLinkHandler: null; popupWindow: null; featureFlags: null; openAdhocToolsPanel: null; dropdownClickHandler: null; }' is not assignable to type 'LaunchPanelHeaderProps'. - Object literal may only specify known properties, and 'supportLinkHandler' does not exist in type 'LaunchPanelHeaderProps'. - In the reference file the supportLinkHandler is removed and dropdownClickHandler is already defined in LaunchPanelHeaderDeps 5. **browserAdapter: browserAdapterMock.object** - **Error:** Type '{ diagnosticViewClickHandler: DiagnosticViewClickHandler; popupViewControllerHandler: PopupViewControllerHandler; launchPanelHeaderClickHandler: LaunchPanelHeaderClickHandler; browserAdapter: BrowserAdapter; }' is not assignable to type 'PopupHandlers'. - Object literal may only specify known properties, and 'browserAdapter' does not exist in type 'PopupHandlers'. 6. **targetAppInfo** - **Error:** Type '{ targetAppInfo: { name: string; url: string; }; description: string; environmentInfo: { browserSpec: string; extensionVersion: string; axeCoreVersion: string; }; toUtcString: (date: Date) => string; scanMetadata: ScanMetadata; }' is not assignable to type 'DetailsSectionProps'. - Object literal may only specify known properties, and 'targetAppInfo' does not exist in type 'DetailsSectionProps'. - Removed 'environmentInfo' property as there are no references defined in 'DetailsSectionProps' type 7. **outcomeType: outcomeType,** - **Error:** Type '{ customCongratsContinueInvestigatingMessage: string; outcomeType: InstanceOutcomeType; }' is not assignable to type 'NoFailedInstancesCongratsDeps'. - Object literal may only specify known properties, and 'outcomeType' does not exist in type 'NoFailedInstancesCongratsDeps'. 8. **pageTitle** - **Error:** Type '{ deps: ResultSectionContentDeps; fixInstructionProcessor: FixInstructionProcessor; recommendColor: RecommendColor; ... 13 more ...; sectionHeadingLevel: 3; }' is not assignable to type 'SectionProps'. - Object literal may only specify known properties, and 'pageTitle' does not exist in type 'SectionProps' - pageUrl,toolData,scanResult doesn't exist in type 'SectionProps'. Hence removed. 9. **deps:null** - **Error:** Type '{ [x: string]: string | number | boolean | JSX.Element; id: string; header: JSX.Element; content: JSX.Element; headingLevel: number; deps: null; isExpanded: boolean; }' is not assignable to type 'ReportCollapsibleContainerProps'. - Object literal may only specify known properties, and 'deps' does not exist in type 'ReportCollapsibleContainerProps'. - isExpanded doesn't exist in type 'ReportCollapsibleContainerProps'. Hence removed. 10. **{ name: 'Any', key: 'any' }** - **Error :** Type '{ name: string; key: string; }' is not assignable to type 'IRequirementSubsetForSummary'. - Object literal may only specify known properties, and 'key' does not exist in type 'IRequirementSubsetForSummary'. 11. **cardSelectionMessageCreator** - **Error:** Type '{ serviceName: string; axeVersion: string; userAgent: string; browserResolution: string; scanDetails: ScanSummaryDetails; results: CombinedReportResults; cardSelectionMessageCreator: CardSelectionMessageCreator; }' is not assignable to type 'CombinedReportParameters'. - Object literal may only specify known properties, and 'cardSelectionMessageCreator' does not exist in type 'CombinedReportParameters'. #### Pull request checklist - [x] Addresses an existing issue: #[[0000](https://github.com/microsoft/accessibility-insights-web/pull/6611)](https://github.com/microsoft/accessibility-insights-web/pull/6611) - [ ] Ran `yarn fastpass` - [x] Added/updated relevant unit test(s) (and ran `yarn test`) - [x] Verified code coverage for the changes made. Check coverage report at: `/test-results/unit/coverage` - [ ] PR title *AND* final merge commit title both start with a semantic tag (`fix:`, `chore:`, `feat(feature-name):`, `refactor:`). See `CONTRIBUTING.md`. - [ ] (UI changes only) Added screenshots/GIFs to description above - [ ] (UI changes only) Verified usability with NVDA/JAWS --------- Co-authored-by: Madalyn <3230904+madalynrose@users.noreply.github.com> --- src/popup/components/popup-view.tsx | 1 - .../components/interactive-header.test.tsx | 4 - .../components/manual-test-step-view.test.tsx | 1 - .../__snapshots__/popup-view.test.tsx.snap | 8 +- .../launch-panel-header-click-handler.test.ts | 4 - .../unit/tests/popup/main-renderer.test.tsx | 4 - .../__snapshots__/report-body.test.tsx.snap | 240 ------------------ .../make-details-section-fc.test.tsx | 6 - .../no-failed-instances-congrats.test.tsx | 2 - .../report-sections/report-body.test.tsx | 15 -- .../report-collapsible-container.test.tsx | 2 - .../get-quick-assess-summary-model.test.ts | 8 +- .../package/combined-results-report.test.ts | 5 - .../tests/views/content/content-page.test.tsx | 14 +- 14 files changed, 17 insertions(+), 297 deletions(-) diff --git a/src/popup/components/popup-view.tsx b/src/popup/components/popup-view.tsx index 76b46bd58f9..081d64f0097 100644 --- a/src/popup/components/popup-view.tsx +++ b/src/popup/components/popup-view.tsx @@ -136,7 +136,6 @@ export class PopupView extends React.Component { ); diff --git a/src/tests/unit/tests/DetailsView/components/interactive-header.test.tsx b/src/tests/unit/tests/DetailsView/components/interactive-header.test.tsx index d33a17d61a4..3cd5a0a7562 100644 --- a/src/tests/unit/tests/DetailsView/components/interactive-header.test.tsx +++ b/src/tests/unit/tests/DetailsView/components/interactive-header.test.tsx @@ -33,7 +33,6 @@ describe('InteractiveHeader', () => { featureFlagStoreData: { 'test-flag': true, }, - avatarUrl: 'avatarUrl', tabClosed, deps: { dropdownClickHandler: dropdownClickHandlerStub, @@ -54,10 +53,7 @@ describe('InteractiveHeader', () => { it.each([false, true])('render: isNavCollapsed equals %s', isNavCollapsed => { const props: InteractiveHeaderProps = { - dropdownClickHandler: null, featureFlagStoreData: null, - connected: null, - avatarUrl: null, tabClosed: false, deps: null, selectedPivot: DetailsViewPivotType.assessment, diff --git a/src/tests/unit/tests/DetailsView/components/manual-test-step-view.test.tsx b/src/tests/unit/tests/DetailsView/components/manual-test-step-view.test.tsx index 21e675b5d10..56abcbdd6a2 100644 --- a/src/tests/unit/tests/DetailsView/components/manual-test-step-view.test.tsx +++ b/src/tests/unit/tests/DetailsView/components/manual-test-step-view.test.tsx @@ -80,7 +80,6 @@ describe('ManualTestStepView', () => { const props: ManualTestStepViewProps = { step: 'step', test: VisualizationType.HeadingsAssessment, - status: ManualTestStatus.FAIL, assessmentInstanceTableHandler: assessmentInstanceTableHandlerMock.object, manualTestStepResultMap: { step: { diff --git a/src/tests/unit/tests/popup/components/__snapshots__/popup-view.test.tsx.snap b/src/tests/unit/tests/popup/components/__snapshots__/popup-view.test.tsx.snap index 8ada66fdfaa..af86260938c 100644 --- a/src/tests/unit/tests/popup/components/__snapshots__/popup-view.test.tsx.snap +++ b/src/tests/unit/tests/popup/components/__snapshots__/popup-view.test.tsx.snap @@ -10,9 +10,7 @@ exports[`PopupView render actual content render toggles view: ad-hoc tools 1`] = featureflags="[object Object]" title="test title" /> - + - + { deps: deps, title: 'title', subtitle: 'subtitle', - supportLinkHandler: null, popupWindow: null, featureFlags: null, openAdhocToolsPanel: null, - dropdownClickHandler: null, }; const header = new LaunchPanelHeader(props); header.setState = setStateMock.object; @@ -102,10 +100,8 @@ describe('FeedbackMenuClickHandlerTest', () => { title: 'title', subtitle: 'subtitle', openAdhocToolsPanel: openAdhocToolsPanelMock.object, - supportLinkHandler: null, popupWindow: null, featureFlags: null, - dropdownClickHandler: null, }; const header = new LaunchPanelHeader(props); diff --git a/src/tests/unit/tests/popup/main-renderer.test.tsx b/src/tests/unit/tests/popup/main-renderer.test.tsx index f7f32053b5d..5164a79973e 100644 --- a/src/tests/unit/tests/popup/main-renderer.test.tsx +++ b/src/tests/unit/tests/popup/main-renderer.test.tsx @@ -4,7 +4,6 @@ import { title } from 'content/strings/application'; import * as React from 'react'; import * as ReactDOM from 'react-dom'; import { IMock, It, Mock } from 'typemoq'; -import { BrowserAdapter } from '../../../../common/browser-adapters/browser-adapter'; import { Theme } from '../../../../common/components/theme'; import { DropdownClickHandler } from '../../../../common/dropdown-click-handler'; import { DiagnosticViewToggleFactory } from '../../../../popup/components/diagnostic-view-toggle-factory'; @@ -34,7 +33,6 @@ describe('MainRenderer', () => { const renderMock: IMock = Mock.ofInstance(() => null); const popupWindowMock = Mock.ofInstance(window); - const browserAdapterMock = Mock.ofType(); const hasAccess = true; const targetTabUrl = 'url'; @@ -56,7 +54,6 @@ describe('MainRenderer', () => { gettingStartedDialogHandlerMock.object, launchPanelHeaderClickHandler: feedbackMenuClickhandlerMock.object, - browserAdapter: browserAdapterMock.object, }} popupWindow={popupWindowMock.object} targetTabUrl={targetTabUrl} @@ -80,7 +77,6 @@ describe('MainRenderer', () => { diagnosticViewClickHandler: diagnosticViewClickHandlerMock.object, popupViewControllerHandler: gettingStartedDialogHandlerMock.object, launchPanelHeaderClickHandler: feedbackMenuClickhandlerMock.object, - browserAdapter: browserAdapterMock.object, }, renderMock.object, fakeDocument, diff --git a/src/tests/unit/tests/reports/components/report-sections/__snapshots__/report-body.test.tsx.snap b/src/tests/unit/tests/reports/components/report-sections/__snapshots__/report-body.test.tsx.snap index 4837f48843f..1777c994e0f 100644 --- a/src/tests/unit/tests/reports/components/report-sections/__snapshots__/report-body.test.tsx.snap +++ b/src/tests/unit/tests/reports/components/report-sections/__snapshots__/report-body.test.tsx.snap @@ -8,16 +8,11 @@ exports[`ReportBody renders 1`] = ` deps="[object Object]" description="test description" fixinstructionprocessor="undefined" - pagetitle="page-title" - pageurl="url:target-page" recommendcolor="undefined" scanmetadata="[object Object]" - scanresult="[object Object]" sectionfactory="[object Object]" sectionheadinglevel="3" shouldalertfailurescount="false" - targetappinfo="[object Object]" - tooldata="[object Object]" /> @@ -26,96 +21,66 @@ exports[`ReportBody renders 1`] = ` deps="[object Object]" description="test description" fixinstructionprocessor="undefined" - pagetitle="page-title" - pageurl="url:target-page" recommendcolor="undefined" scanmetadata="[object Object]" - scanresult="[object Object]" sectionfactory="[object Object]" sectionheadinglevel="3" shouldalertfailurescount="false" - targetappinfo="[object Object]" - tooldata="[object Object]" /> @@ -125,16 +90,11 @@ exports[`ReportBody renders 1`] = ` deps="[object Object]" description="test description" fixinstructionprocessor="undefined" - pagetitle="page-title" - pageurl="url:target-page" recommendcolor="undefined" scanmetadata="[object Object]" - scanresult="[object Object]" sectionfactory="[object Object]" sectionheadinglevel="3" shouldalertfailurescount="false" - targetappinfo="[object Object]" - tooldata="[object Object]" /> @@ -197,8 +157,6 @@ exports[`ReportBody renders: allOutcomesSummarySectionProps 1`] = ` "fixInstructionProcessor": [typemoq mock object], "getCollapsibleScript": [Function], "getGuidanceTagsFromGuidanceLinks": [Function], - "pageTitle": "page-title", - "pageUrl": "url:target-page", "recommendColor": [typemoq mock object], "scanMetadata": { "targetAppInfo": { @@ -219,33 +177,10 @@ exports[`ReportBody renders: allOutcomesSummarySectionProps 1`] = ` }, }, }, - "scanResult": { - "inapplicable": [], - "incomplete": [], - "passes": [], - "targetPageTitle": "page-title", - "targetPageUrl": "url:target-page", - "timestamp": "today", - "violations": [], - }, "sectionFactory": "Removed for Snapshot", "sectionHeadingLevel": 3, "shouldAlertFailuresCount": false, - "targetAppInfo": { - "name": "app", - }, "toUtcString": [Function], - "toolData": { - "applicationProperties": { - "environmentName": "environmentName", - "name": "app-name", - "version": "app-version", - }, - "scanEngineProperties": { - "name": "engine-name", - "version": "engine-version", - }, - }, "userConfigurationStoreData": null, } `; @@ -306,8 +241,6 @@ exports[`ReportBody renders: detailsSectionProps 1`] = ` "fixInstructionProcessor": [typemoq mock object], "getCollapsibleScript": [Function], "getGuidanceTagsFromGuidanceLinks": [Function], - "pageTitle": "page-title", - "pageUrl": "url:target-page", "recommendColor": [typemoq mock object], "scanMetadata": { "targetAppInfo": { @@ -328,33 +261,10 @@ exports[`ReportBody renders: detailsSectionProps 1`] = ` }, }, }, - "scanResult": { - "inapplicable": [], - "incomplete": [], - "passes": [], - "targetPageTitle": "page-title", - "targetPageUrl": "url:target-page", - "timestamp": "today", - "violations": [], - }, "sectionFactory": "Removed for Snapshot", "sectionHeadingLevel": 3, "shouldAlertFailuresCount": false, - "targetAppInfo": { - "name": "app", - }, "toUtcString": [Function], - "toolData": { - "applicationProperties": { - "environmentName": "environmentName", - "name": "app-name", - "version": "app-version", - }, - "scanEngineProperties": { - "name": "engine-name", - "version": "engine-version", - }, - }, "userConfigurationStoreData": null, } `; @@ -415,8 +325,6 @@ exports[`ReportBody renders: failedInstancesSectionProps 1`] = ` "fixInstructionProcessor": [typemoq mock object], "getCollapsibleScript": [Function], "getGuidanceTagsFromGuidanceLinks": [Function], - "pageTitle": "page-title", - "pageUrl": "url:target-page", "recommendColor": [typemoq mock object], "scanMetadata": { "targetAppInfo": { @@ -437,33 +345,10 @@ exports[`ReportBody renders: failedInstancesSectionProps 1`] = ` }, }, }, - "scanResult": { - "inapplicable": [], - "incomplete": [], - "passes": [], - "targetPageTitle": "page-title", - "targetPageUrl": "url:target-page", - "timestamp": "today", - "violations": [], - }, "sectionFactory": "Removed for Snapshot", "sectionHeadingLevel": 3, "shouldAlertFailuresCount": false, - "targetAppInfo": { - "name": "app", - }, "toUtcString": [Function], - "toolData": { - "applicationProperties": { - "environmentName": "environmentName", - "name": "app-name", - "version": "app-version", - }, - "scanEngineProperties": { - "name": "engine-name", - "version": "engine-version", - }, - }, "userConfigurationStoreData": null, } `; @@ -524,8 +409,6 @@ exports[`ReportBody renders: footerTextPropsProps 1`] = ` "fixInstructionProcessor": [typemoq mock object], "getCollapsibleScript": [Function], "getGuidanceTagsFromGuidanceLinks": [Function], - "pageTitle": "page-title", - "pageUrl": "url:target-page", "recommendColor": [typemoq mock object], "scanMetadata": { "targetAppInfo": { @@ -546,33 +429,10 @@ exports[`ReportBody renders: footerTextPropsProps 1`] = ` }, }, }, - "scanResult": { - "inapplicable": [], - "incomplete": [], - "passes": [], - "targetPageTitle": "page-title", - "targetPageUrl": "url:target-page", - "timestamp": "today", - "violations": [], - }, "sectionFactory": "Removed for Snapshot", "sectionHeadingLevel": 3, "shouldAlertFailuresCount": false, - "targetAppInfo": { - "name": "app", - }, "toUtcString": [Function], - "toolData": { - "applicationProperties": { - "environmentName": "environmentName", - "name": "app-name", - "version": "app-version", - }, - "scanEngineProperties": { - "name": "engine-name", - "version": "engine-version", - }, - }, "userConfigurationStoreData": null, } `; @@ -633,8 +493,6 @@ exports[`ReportBody renders: notApplicableChecksSectionProps 1`] = ` "fixInstructionProcessor": [typemoq mock object], "getCollapsibleScript": [Function], "getGuidanceTagsFromGuidanceLinks": [Function], - "pageTitle": "page-title", - "pageUrl": "url:target-page", "recommendColor": [typemoq mock object], "scanMetadata": { "targetAppInfo": { @@ -655,33 +513,10 @@ exports[`ReportBody renders: notApplicableChecksSectionProps 1`] = ` }, }, }, - "scanResult": { - "inapplicable": [], - "incomplete": [], - "passes": [], - "targetPageTitle": "page-title", - "targetPageUrl": "url:target-page", - "timestamp": "today", - "violations": [], - }, "sectionFactory": "Removed for Snapshot", "sectionHeadingLevel": 3, "shouldAlertFailuresCount": false, - "targetAppInfo": { - "name": "app", - }, "toUtcString": [Function], - "toolData": { - "applicationProperties": { - "environmentName": "environmentName", - "name": "app-name", - "version": "app-version", - }, - "scanEngineProperties": { - "name": "engine-name", - "version": "engine-version", - }, - }, "userConfigurationStoreData": null, } `; @@ -742,8 +577,6 @@ exports[`ReportBody renders: passedChecksSectionProps 1`] = ` "fixInstructionProcessor": [typemoq mock object], "getCollapsibleScript": [Function], "getGuidanceTagsFromGuidanceLinks": [Function], - "pageTitle": "page-title", - "pageUrl": "url:target-page", "recommendColor": [typemoq mock object], "scanMetadata": { "targetAppInfo": { @@ -764,33 +597,10 @@ exports[`ReportBody renders: passedChecksSectionProps 1`] = ` }, }, }, - "scanResult": { - "inapplicable": [], - "incomplete": [], - "passes": [], - "targetPageTitle": "page-title", - "targetPageUrl": "url:target-page", - "timestamp": "today", - "violations": [], - }, "sectionFactory": "Removed for Snapshot", "sectionHeadingLevel": 3, "shouldAlertFailuresCount": false, - "targetAppInfo": { - "name": "app", - }, "toUtcString": [Function], - "toolData": { - "applicationProperties": { - "environmentName": "environmentName", - "name": "app-name", - "version": "app-version", - }, - "scanEngineProperties": { - "name": "engine-name", - "version": "engine-version", - }, - }, "userConfigurationStoreData": null, } `; @@ -852,8 +662,6 @@ exports[`ReportBody renders: resultsContainerProps 1`] = ` "fixInstructionProcessor": [typemoq mock object], "getCollapsibleScript": [Function], "getGuidanceTagsFromGuidanceLinks": [Function], - "pageTitle": "page-title", - "pageUrl": "url:target-page", "recommendColor": [typemoq mock object], "scanMetadata": { "targetAppInfo": { @@ -874,33 +682,10 @@ exports[`ReportBody renders: resultsContainerProps 1`] = ` }, }, }, - "scanResult": { - "inapplicable": [], - "incomplete": [], - "passes": [], - "targetPageTitle": "page-title", - "targetPageUrl": "url:target-page", - "timestamp": "today", - "violations": [], - }, "sectionFactory": "Removed for Snapshot", "sectionHeadingLevel": 3, "shouldAlertFailuresCount": false, - "targetAppInfo": { - "name": "app", - }, "toUtcString": [Function], - "toolData": { - "applicationProperties": { - "environmentName": "environmentName", - "name": "app-name", - "version": "app-version", - }, - "scanEngineProperties": { - "name": "engine-name", - "version": "engine-version", - }, - }, "userConfigurationStoreData": null, } `; @@ -961,8 +746,6 @@ exports[`ReportBody renders: sectionProps 1`] = ` "fixInstructionProcessor": [typemoq mock object], "getCollapsibleScript": [Function], "getGuidanceTagsFromGuidanceLinks": [Function], - "pageTitle": "page-title", - "pageUrl": "url:target-page", "recommendColor": [typemoq mock object], "scanMetadata": { "targetAppInfo": { @@ -983,33 +766,10 @@ exports[`ReportBody renders: sectionProps 1`] = ` }, }, }, - "scanResult": { - "inapplicable": [], - "incomplete": [], - "passes": [], - "targetPageTitle": "page-title", - "targetPageUrl": "url:target-page", - "timestamp": "today", - "violations": [], - }, "sectionFactory": "Removed for Snapshot", "sectionHeadingLevel": 3, "shouldAlertFailuresCount": false, - "targetAppInfo": { - "name": "app", - }, "toUtcString": [Function], - "toolData": { - "applicationProperties": { - "environmentName": "environmentName", - "name": "app-name", - "version": "app-version", - }, - "scanEngineProperties": { - "name": "engine-name", - "version": "engine-version", - }, - }, "userConfigurationStoreData": null, } `; diff --git a/src/tests/unit/tests/reports/components/report-sections/make-details-section-fc.test.tsx b/src/tests/unit/tests/reports/components/report-sections/make-details-section-fc.test.tsx index 863287a69e5..34ce66b12f4 100644 --- a/src/tests/unit/tests/reports/components/report-sections/make-details-section-fc.test.tsx +++ b/src/tests/unit/tests/reports/components/report-sections/make-details-section-fc.test.tsx @@ -58,13 +58,7 @@ describe('makeDetailsSection', () => { test.each(descriptionValues)('renders with description: %s', description => { const props: DetailsSectionProps = { - targetAppInfo, description, - environmentInfo: { - browserSpec: 'environment-version', - extensionVersion: 'extension-version', - axeCoreVersion: 'axe-version', - }, toUtcString: toUtcStringMock.object, scanMetadata, }; diff --git a/src/tests/unit/tests/reports/components/report-sections/no-failed-instances-congrats.test.tsx b/src/tests/unit/tests/reports/components/report-sections/no-failed-instances-congrats.test.tsx index 217aeea1759..9e278a0655e 100644 --- a/src/tests/unit/tests/reports/components/report-sections/no-failed-instances-congrats.test.tsx +++ b/src/tests/unit/tests/reports/components/report-sections/no-failed-instances-congrats.test.tsx @@ -19,7 +19,6 @@ describe.each(allInstanceOutcomeTypes)( it('renders per snapshot with default message', () => { const deps: NoFailedInstancesCongratsDeps = { customCongratsContinueInvestigatingMessage: null, - outcomeType: outcomeType, }; const renderResult = render( , @@ -31,7 +30,6 @@ describe.each(allInstanceOutcomeTypes)( it('renders per snapshot with custom message', () => { const deps: NoFailedInstancesCongratsDeps = { customCongratsContinueInvestigatingMessage: 'Continue investigating!', - outcomeType: outcomeType, }; const renderResult = render( , diff --git a/src/tests/unit/tests/reports/components/report-sections/report-body.test.tsx b/src/tests/unit/tests/reports/components/report-sections/report-body.test.tsx index 6f88553119b..4a5718e9593 100644 --- a/src/tests/unit/tests/reports/components/report-sections/report-body.test.tsx +++ b/src/tests/unit/tests/reports/components/report-sections/report-body.test.tsx @@ -59,8 +59,6 @@ describe('ReportBody', () => { NotApplicableChecksSection, ]); it('renders', () => { - const pageTitle = 'page-title'; - const pageUrl = 'url:target-page'; const scanDate = new Date(Date.UTC(0, 1, 2, 3)); const getScriptStub = () => ''; const getGuidanceTagsStub = () => []; @@ -83,19 +81,7 @@ describe('ReportBody', () => { deps: {} as CommonInstancesSectionDeps, fixInstructionProcessor: fixInstructionProcessorMock.object, recommendColor: recommendColorMock.object, - pageTitle, - pageUrl, description: 'test description', - toolData, - scanResult: { - passes: [], - violations: [], - inapplicable: [], - incomplete: [], - timestamp: 'today', - targetPageTitle: pageTitle, - targetPageUrl: pageUrl, - }, toUtcString: () => '', getCollapsibleScript: getScriptStub, getGuidanceTagsFromGuidanceLinks: getGuidanceTagsStub, @@ -105,7 +91,6 @@ describe('ReportBody', () => { allCardsCollapsed: true, }, userConfigurationStoreData: null, - targetAppInfo, shouldAlertFailuresCount: false, scanMetadata: { toolData, diff --git a/src/tests/unit/tests/reports/components/report-sections/report-collapsible-container.test.tsx b/src/tests/unit/tests/reports/components/report-sections/report-collapsible-container.test.tsx index fb4f49cc6d8..69cea76e53d 100644 --- a/src/tests/unit/tests/reports/components/report-sections/report-collapsible-container.test.tsx +++ b/src/tests/unit/tests/reports/components/report-sections/report-collapsible-container.test.tsx @@ -30,8 +30,6 @@ describe('ReportCollapsibleContainerControl', () => { content:
Some content
, headingLevel: 5, [propertyName]: value, - deps: null, - isExpanded: false, }; const control = ReportCollapsibleContainerControl(props); const renderResult = render(control); diff --git a/src/tests/unit/tests/reports/get-quick-assess-summary-model.test.ts b/src/tests/unit/tests/reports/get-quick-assess-summary-model.test.ts index d5dd1d69d75..33cd7b8ed70 100644 --- a/src/tests/unit/tests/reports/get-quick-assess-summary-model.test.ts +++ b/src/tests/unit/tests/reports/get-quick-assess-summary-model.test.ts @@ -17,7 +17,7 @@ import { } from 'reports/get-quick-assess-summary-model'; import { IMock, It, Mock } from 'typemoq'; -type IRequirementSubsetForSummary = Pick; +type IRequirementSubsetForSummary = Pick; type IAssessmentSubsetForSummary = Pick & { requirements: IRequirementSubsetForSummary[]; }; @@ -77,9 +77,9 @@ describe('getQuickAssessSummaryModel', () => { visualizationType: 0, requirements: [ { name: 'Any', key: 'any' }, - { name: 'Name', key: 'name' }, - { name: 'Will', key: 'will' }, - { name: 'Do', key: 'do' }, + { name: 'Name', key: 'Name' }, + { name: 'Will', key: 'Will' }, + { name: 'Do', key: 'Do' }, ], }, test1: { diff --git a/src/tests/unit/tests/reports/package/combined-results-report.test.ts b/src/tests/unit/tests/reports/package/combined-results-report.test.ts index e1faadf2a07..ce1d89fa5ca 100644 --- a/src/tests/unit/tests/reports/package/combined-results-report.test.ts +++ b/src/tests/unit/tests/reports/package/combined-results-report.test.ts @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -import { CardSelectionMessageCreator } from "common/message-creators/card-selection-message-creator"; import { CardsViewModel } from "common/types/store-data/card-view-model"; import { ToolData } from "common/types/store-data/unified-data-interface"; import { CombinedReportHtmlGenerator } from "reports/combined-report-html-generator"; @@ -13,7 +12,6 @@ import { IMock, Mock } from "typemoq"; describe('CombinedResultsReport', () => { let reportHtmlGeneratorMock: IMock; let resultsToCardsConverterMock: IMock; - let cardSelectionMessageCreatorMock: IMock; let combinedResultsReport: CombinedResultsReport; @@ -75,7 +73,6 @@ describe('CombinedResultsReport', () => { beforeEach(() => { reportHtmlGeneratorMock = Mock.ofType(CombinedReportHtmlGenerator); resultsToCardsConverterMock = Mock.ofType(); - cardSelectionMessageCreatorMock = Mock.ofType(); parameters = { serviceName: 'service name', axeVersion: 'axe version', @@ -83,13 +80,11 @@ describe('CombinedResultsReport', () => { browserResolution: '1920x1080', scanDetails: scanDetails, results, - cardSelectionMessageCreator: cardSelectionMessageCreatorMock.object }; const deps = { reportHtmlGenerator: reportHtmlGeneratorMock.object, - cardSelectionMessageCreator: cardSelectionMessageCreatorMock.object, }; combinedResultsReport = new CombinedResultsReport( deps, diff --git a/src/tests/unit/tests/views/content/content-page.test.tsx b/src/tests/unit/tests/views/content/content-page.test.tsx index 79768fefda1..7a628b19524 100644 --- a/src/tests/unit/tests/views/content/content-page.test.tsx +++ b/src/tests/unit/tests/views/content/content-page.test.tsx @@ -6,8 +6,13 @@ import * as React from 'react'; import { Mock } from 'typemoq'; import { ContentCreator, ContentPage, ContentPageDeps } from 'views/content/content-page'; +import { MarkupOptions } from '../../../../../views/content/markup'; import { mockReactComponents } from '../../../mock-helpers/mock-module-helpers'; jest.mock('common/components/new-tab-link'); + +interface ExtendedMarkupOptions extends MarkupOptions { + testString: string; +} describe('ContentPage', () => { const deps = Mock.ofType().object; @@ -27,9 +32,12 @@ describe('ContentPage', () => { return <>{(Markup as any).options.testString}; }); - const renderResult = render( - , - ); + const options: ExtendedMarkupOptions = { + setPageTitle: true, + testString: 'TEST STRING', + }; + + const renderResult = render(); expect(renderResult.asFragment()).toMatchSnapshot(); }); });