Skip to content

chore: Typescript Cleanup- Part 2 for Test Files #7269

Merged
JeevaniChinthala merged 3 commits intomainfrom
users/v-jeevanic/TypeScriptFeatureV2
Apr 1, 2024
Merged

chore: Typescript Cleanup- Part 2 for Test Files #7269
JeevaniChinthala merged 3 commits intomainfrom
users/v-jeevanic/TypeScriptFeatureV2

Conversation

@JeevaniChinthala
Copy link
Copy Markdown
Contributor

@JeevaniChinthala JeevaniChinthala commented Mar 12, 2024

Details

As part of Typescript migration added/removed the error causing fields. As most of the files are test cases which were removed from actual file but not updated the test case files.

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. displayName: 'JSON'

  • Error: Type '{ key: "json"; displayName: string; generateMenuItem: (onMenuItemClick: (event: MouseEvent<HTMLButtonElement | HTMLAnchorElement, MouseEvent>, selectedServiceKey: ReportExportServiceKey) => void, href: string, download: string) => { ...; }; }' is not assignable to type 'ReportExportService'.
  • Object literal may only specify known properties, and 'displayName' does not exist in type 'ReportExportService'.

2. columnConfiguration: []

  • Error : Type '{ instancesMap: DictionaryStringTo<GeneratedAssessmentInstance<{}, {}>>; columnConfiguration: undefined[]; assessmentNavState: { ...; }; ... 4 more ...; hasVisualHelper: true; }' is not assignable to type 'AssessmentInstanceTableProps'
  • Object literal may only specify known properties, and 'columnConfiguration' does not exist in type 'AssessmentInstanceTableProps'.

3. noClick

  • Error: Property 'noClick' does not exist on type

4. newTab: newTab

  • Error: Type '{ deps: { urlParser: UrlParser; getAssessmentActionMessageCreator: () => AssessmentActionMessageCreator; detailsViewId: undefined; }; prevTab: PersistedTabInfo; ... 4 more ...; isOpen: true; }' is not assignable to type 'LoadAssessmentDialogProps'.
  • Object literal may only specify known properties, and 'newTab' does not exist in type 'LoadAssessmentDialogProps'.

5. showAssessment: true

  • Error: Type '{ showAssessment: true; showTest: true; }' is not assignable to type 'StartOverContextMenuKeyOptions'.
    Object literal may only specify known properties, and 'showAssessment' does not exist in type 'StartOverContextMenuKeyOptions'.
  • In actual file they removed the StartOverContextMenuKeyOptions 'showAssessment: true,' and didn't removed from test file

6. status: 'fail'

  • Error: Type '{ deps: { tabStopRequirementActionMessageCreator: TabStopRequirementActionMessageCreator; tabStopsTestViewController: TabStopsTestViewController; }; requirementState: TabStopRequirementState; status: string; }' is not assignable to type 'TabStopsRequirementsTableProps'.
  • Object literal may only specify known properties, and 'status' does not exist in type 'TabStopsRequirementsTableProps'

7. highlightState: 'hidden

  • Error: Type '{ deps: InstanceDetailsFooterDeps; result: CardResult; rule: UnifiedRule; targetAppInfo: TargetAppData; highlightState: string; userConfigurationStoreData: UserConfigurationStoreData; }' is not assignable to type 'InstanceDetailsFooterProps'.
  • Object literal may only specify known properties, and 'highlightState' does not exist in type 'InstanceDetailsFooterProps'.
  • highlightState was removed from actual file and didn't update the test case.

8. fixInstructionProcessor

  • Error: Type '{ deps: InstanceDetailsGroupDeps; fixInstructionProcessor: FixInstructionProcessor; recommendColor: RecommendColor; rule: CardRuleResult; userConfigurationStoreData: null; targetAppInfo: { ...; }; cardSelectionMessageCreator: CardSelectionMessageCreator; }' is not assignable to type 'InstanceDetailsGroupProps'.
  • Object literal may only specify known properties, and 'fixInstructionProcessor' does not exist in type 'InstanceDetailsGroupProps'.

9. showCongratsIfNotInstances: true

  • Error: Type '{ deps: ResultSectionContentDeps; results: CardRuleResult[]; outcomeType: "pass"; showCongratsIfNotInstances: boolean; userConfigurationStoreData: null; ... 5 more ...; cardSelectionMessageCreator: CardSelectionMessageCreator; }' is not assignable to type 'ResultSectionContentProps'.
  • Object literal may only specify known properties, and 'showCongratsIfNotInstances' does not exist in type 'ResultSectionContentProps'.

10. iconName="test icon"

  • Error : Type '{ deps: { contentProvider: ContentProvider; contentActionMessageCreator: ContentActionMessageCreator; }; guidance: string; headingTitle: string; iconName: string; }' is not assignable to type 'IntrinsicAttributes & HeaderWithContentLinkProps & { children?: ReactNode; }'
  • Property 'iconName' does not exist on type 'IntrinsicAttributes & HeaderWithContentLinkProps

11. selectedTest: VisualizationType[-1]

  • Here for this error the props imported was wrong instead of AssessmentRequirementScanTelemetryData they used RuleAnalyzerScanTelemetryData due to this getting error.

12. requirementName

  • Error: Type '{ scanDuration: number; NumberOfElementsScanned: number; include: undefined[]; exclude: undefined[]; testName: string; requirementName: string; }' is not assignable to type 'RuleAnalyzerScanTelemetryData'.
    Object literal may only specify known properties, and 'requirementName' does not exist in type 'RuleAnalyzerScanTelemetryData'.

13. 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'.

14. featureFlagStoreData: {},

  • Error: Type '{ container: DetailsDialog; dialogHandler: IssueDetailsNavigationClickHandler; featureFlagStoreData: {}; failuresCount: number; }' is not assignable to type 'IssueDetailsNavigationControlsProps'.
  • Object literal may only specify known properties, and 'featureFlagStoreData' does not exist in type 'IssueDetailsNavigationControlsProps'.

15. userConfigurationStoreData

  • Error: Type '{ deps: IssueFilingSettingsContainerDeps; selectedIssueFilingService: IssueFilingService; userConfigurationStoreData: UserConfigurationStoreData; selectedIssueFilingServiceData: IssueFilingServiceProperties; onPropertyUpdateCallback: () => any; onSelectedServiceChange: () => any; }' is not assignable to type 'IssueFilingSettingsContainerProps'.
  • Object literal may only specify known properties, and 'userConfigurationStoreData' does not exist in type 'IssueFilingSettingsContainerProps'.

16. featureFlagStoreData: {},

  • Error: Type '{ backLinkHandler: () => void; diagnosticViewToggleFactory: DiagnosticViewToggleFactory; featureFlagStoreData: {}; }' is not assignable to type 'AdHocToolsPanelProps'.
  • Object literal may only specify known properties, and 'featureFlagStoreData' does not exist in type 'AdHocToolsPanelProps'.

17. shortcutModifyHandler

  • Error: Argument of type '{ diagnosticViewClickHandler: null; popupViewControllerHandler: PopupViewControllerHandler; launchPanelHeaderClickHandler: null; shortcutModifyHandler: null; }' is not assignable to parameter of type 'PopupHandlers'.
  • Object literal may only specify known properties, and 'shortcutModifyHandler' does not exist in type 'PopupHandlers'.

Pull request checklist

  • Addresses an existing issue: #(chore: Remove deprecated TypeScript options #6611)
  • Ran yarn fastpass
  • Added/updated relevant unit test(s) (and ran yarn test)
  • 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

@JeevaniChinthala JeevaniChinthala marked this pull request as ready for review March 18, 2024 13:39
@JeevaniChinthala JeevaniChinthala requested a review from a team as a code owner March 18, 2024 13:39
@v-viyada v-viyada changed the title chore: Typescript Cleanup- Part 3 of 1 for Test Files chore: Typescript Cleanup- Part 2 for Test Files Mar 18, 2024
Copy link
Copy Markdown
Contributor

@DaveTryon DaveTryon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes look good to me. None of the deleted properties exist in the type definitions, and since we're dealing almost exclusively with test code, the risk seems very low.

That said, I'd love to get a second review on these changes.

@DaveTryon DaveTryon added the pr: second review required Author has requested an additional review. label Mar 18, 2024
@JeevaniChinthala JeevaniChinthala merged commit 4cde9af into main Apr 1, 2024
@JeevaniChinthala JeevaniChinthala deleted the users/v-jeevanic/TypeScriptFeatureV2 branch May 23, 2024 05:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr: second review required Author has requested an additional review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants