Skip to content

chore: Typescript Cleanup- Part 3 for Test Files#7291

Merged
v-viyada merged 6 commits intomainfrom
users/v-jeevanic/TypeScriptFeatureV3
Apr 11, 2024
Merged

chore: Typescript Cleanup- Part 3 for Test Files#7291
v-viyada merged 6 commits intomainfrom
users/v-jeevanic/TypeScriptFeatureV3

Conversation

@JeevaniChinthala
Copy link
Copy Markdown
Contributor

@JeevaniChinthala JeevaniChinthala commented Apr 1, 2024

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; }'.
  1. 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'.
  1. 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'.
  1. 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
  1. 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'.
  1. 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
  1. 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'.
  1. 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.
  1. 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.
  1. { 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'.
  1. 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

  • Addresses an existing issue: #[0000](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 changed the title chore: Typescript Cleanup- Part 3 chore: Typescript Cleanup- Part 3 for Test Files Apr 1, 2024
@v-viyada v-viyada marked this pull request as ready for review April 1, 2024 22:42
@v-viyada v-viyada requested a review from a team as a code owner April 1, 2024 22:42
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.

Some of the items that were removed (like the featureFlagStoreData accessor) were likely used for features that were at one point still under development. I like removing them now, even though it means potentially re-adding them (with correct support in the types) at some future time.

There's always the risk that we've broken something, but since we need to a full accessibility test pass before releasing with the FluentUI update, this seems like the right time to make this sort of extensive change.

@v-viyada
Copy link
Copy Markdown
Contributor

v-viyada commented Apr 2, 2024

Some of the items that were removed (like the featureFlagStoreData accessor) were likely used for features that were at one point still under development. I like removing them now, even though it means potentially re-adding them (with correct support in the types) at some future time.

There's always the risk that we've broken something, but since we need to a full accessibility test pass before releasing with the FluentUI update, this seems like the right time to make this sort of extensive change.

Hi @DaveTryon,
This will go with axe-core update release if merged before #7274 . Should we hold this PR and merge after axe-core update PR?

@madalynrose madalynrose self-requested a review April 5, 2024 16:37
Copy link
Copy Markdown
Contributor

@madalynrose madalynrose left a comment

Choose a reason for hiding this comment

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

A couple small changes but overall looks good! love seeing so much deleted code!

@madalynrose
Copy link
Copy Markdown
Contributor

Some of the items that were removed (like the featureFlagStoreData accessor) were likely used for features that were at one point still under development. I like removing them now, even though it means potentially re-adding them (with correct support in the types) at some future time.

There's always the risk that we've broken something, but since we need to a full accessibility test pass before releasing with the FluentUI update, this seems like the right time to make this sort of extensive change.

I looked and this instance of featureFlagStoreData was added in #5736 and should have been removed in #5971. Looks like this particular instance was just missed.

@v-viyada v-viyada requested a review from madalynrose April 8, 2024 16:14
Copy link
Copy Markdown
Contributor

@madalynrose madalynrose left a comment

Choose a reason for hiding this comment

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

One small tweak and then I think this is good to go!

export interface MarkupOptions {
setPageTitle?: boolean;
}
export interface ExtendedMarkupOptions extends MarkupOptions {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Let's move this to the top of the test file since it isn't needed for any production code.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated.

Copy link
Copy Markdown
Contributor

@madalynrose madalynrose left a comment

Choose a reason for hiding this comment

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

One small tweak and then I think this is ready to go! (Double review I guess because GH errored out when I submitted the other one and I thought it hadn't gone through)

Copy link
Copy Markdown
Contributor

@madalynrose madalynrose left a comment

Choose a reason for hiding this comment

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

One additional small tweak!

Co-authored-by: Madalyn <3230904+madalynrose@users.noreply.github.com>
@v-viyada v-viyada merged commit 15c1507 into main Apr 11, 2024
@JeevaniChinthala JeevaniChinthala deleted the users/v-jeevanic/TypeScriptFeatureV3 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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants