Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Typescript Cleanup- Part 3 for Test Files (microsoft#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 <!-- If a checklist item is not applicable to this change, write "n/a" in the checkbox --> - [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: `<rootDir>/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 <[email protected]>
- Loading branch information