Skip to content

#12029 – Refactor: InfoModal.test.utils from JS to TS - #12069

Open
GaborHeger wants to merge 1 commit into
masterfrom
12029-infomodal-test-utils-js-to-ts
Open

GaborHeger wants to merge 1 commit into
masterfrom
12029-infomodal-test-utils-js-to-ts

Conversation

@GaborHeger

@GaborHeger GaborHeger commented Oct 1, 2026 •

Copy link
Copy Markdown
Collaborator

How the feature works? / How did you fix the issue?

(Screenshots, videos, or GIFs, if applicable)

Refactiored InfoModal.test.utils.js to TypeScript (InfoModal.test.utils.tsx) and removed all implicit any types.

  • Typed renderWithMockStore parameters: component: ReactElement, initialState: InfoModalMockState, store: Store<InfoModalMockState>.
  • Added a local InfoModalMockState interface for the mock store shape (options.app.errorMessage). It's test-only, so it isn't added to the shared types.
  • Replaced createStore(modalReducer, initialState) with legacy_createStore and a pass-through reducer. The mock state isn't a ModalState, so using modalReducer would need an unsafe cast. At runtime it only returned the state unchanged, so behavior is the same.
    (legacy_createStore avoids the Redux 5 deprecation warning without adding @reduxjs/toolkit.)
  • No changes to InfoModal.test.tsx; the import path resolves to the new file.

Check list

  • unit-tests written
  • e2e-tests written
  • documentation updated
  • PR name follows the pattern #1234 – issue name
  • branch name doesn't contain '#'
  • PR is linked with the issue
  • base branch (master or release/xx) is correct
  • task status changed to "Code review"
  • reviewers are notified about the pull request
@GaborHeger GaborHeger changed the title #12029 – InfoModal.test.utils refactor from JS to TS Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant