Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor/select component tests #1637

Closed
wants to merge 15 commits into from

Conversation

AndreasBerliner
Copy link
Collaborator

@AndreasBerliner AndreasBerliner commented Jan 9, 2025

💡 What is the current behavior?

  • The keyboard navigation does not work as expected for the ix-select component when new items are added.
  • The readability and stability of the unit tests for the ix-select keyboard navigation need to be improved.

GitHub Issue Number:

🆕 What is the new behavior?

  • The ix-select keyboard navigation works as expected and all dropdown items can be focused also when new items are added.
  • The ix-select keyboard navigation unit tests were refactored and the readability was improved.

🏁 Checklist

A pull request can only be merged if all of these conditions are met (where applicable):

  • 🦮 Accessibility (a11y) features were implemented
  • 🗺️ Internationalization (i18n) - no hard coded strings
  • 📲 Responsiveness - components handle viewport changes and content overflow gracefully
  • 📄 Documentation was reviewed/updated (pnpm run docs)
  • 🧪 Unit tests were added/updated and pass (pnpm test)
  • 📸 Visual regression tests were added/updated and pass (Guide)
  • 🧐 Static code analysis passes (pnpm lint)
  • 🏗️ Successful compilation (pnpm build, changes pushed)

👨‍💻 Help & support

Copy link

changeset-bot bot commented Jan 9, 2025

🦋 Changeset detected

Latest commit: c941cb2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@siemens/ix Patch
@siemens/ix-aggrid Patch
@siemens/ix-angular Patch
@siemens/ix-react Patch
@siemens/ix-vue Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

github-actions bot commented Jan 9, 2025

Report of strict check

src/components/select/select.tsx
  • src/components/select/select.tsx(472,7): error TS2345: Argument of type 'HTMLIxDropdownElement | undefined' is not assignable to parameter of type 'HTMLElement'.: error TS2345: Argument of type 'HTMLIxDropdownElement | undefined' is not assignable to parameter of type 'HTMLElement'.
src/components/select/test/select-keyboard.ct.ts
  • src/components/select/test/select-keyboard.ct.ts(18,11): error TS2531: Object is possibly 'null'.: error TS2531: Object is possibly 'null'.
  • src/components/select/test/select-keyboard.ct.ts(72,13): error TS2531: Object is possibly 'null'.: error TS2531: Object is possibly 'null'.
  • src/components/select/test/select-keyboard.ct.ts(80,14): error TS2531: Object is possibly 'null'.: error TS2531: Object is possibly 'null'.
  • src/components/select/test/select-keyboard.ct.ts(251,49): error TS2339: Property 'toHaveText' does not exist on type 'MakeMatchers<void, Locator | undefined, {}>'.: error TS2339: Property 'toHaveText' does not exist on type 'MakeMatchers<void, Locator | undefined, {}>'.
  • src/components/select/test/select-keyboard.ct.ts(252,53): error TS2339: Property 'toBeFocused' does not exist on type '(MakeMatchers<void, Locator | undefined, {}> & LocatorAssertions) | (MakeMatchers<void, Locator | undefined, {}> & GenericAssertions<...>)'.: error TS2339: Property 'toBeFocused' does not exist on type '(MakeMatchers<void, Locator | undefined, {}> & LocatorAssertions) | (MakeMatchers<void, Locator | undefined, {}> & GenericAssertions<...>)'.
  • src/components/select/test/select-keyboard.ct.ts(253,49): error TS2339: Property 'toBeFocused' does not exist on type 'MakeMatchers<void, Locator | undefined, {}>'.: error TS2339: Property 'toBeFocused' does not exist on type 'MakeMatchers<void, Locator | undefined, {}>'.
  • src/components/select/test/select-keyboard.ct.ts(258,48): error TS2339: Property 'toHaveText' does not exist on type 'MakeMatchers<void, Locator | undefined, {}>'.: error TS2339: Property 'toHaveText' does not exist on type 'MakeMatchers<void, Locator | undefined, {}>'.
  • src/components/select/test/select-keyboard.ct.ts(259,48): error TS2339: Property 'toBeFocused' does not exist on type 'MakeMatchers<void, Locator | undefined, {}>'.: error TS2339: Property 'toBeFocused' does not exist on type 'MakeMatchers<void, Locator | undefined, {}>'.
  • src/components/select/test/select-keyboard.ct.ts(260,52): error TS2339: Property 'toBeFocused' does not exist on type '(MakeMatchers<void, Locator | undefined, {}> & LocatorAssertions) | (MakeMatchers<void, Locator | undefined, {}> & GenericAssertions<...>)'.: error TS2339: Property 'toBeFocused' does not exist on type '(MakeMatchers<void, Locator | undefined, {}> & LocatorAssertions) | (MakeMatchers<void, Locator | undefined, {}> & GenericAssertions<...>)'.
  • src/components/select/test/select-keyboard.ct.ts(284,48): error TS2339: Property 'toBeFocused' does not exist on type 'MakeMatchers<void, Locator | undefined, {}>'.: error TS2339: Property 'toBeFocused' does not exist on type 'MakeMatchers<void, Locator | undefined, {}>'.
  • src/components/select/test/select-keyboard.ct.ts(285,48): error TS2339: Property 'toHaveText' does not exist on type 'MakeMatchers<void, Locator | undefined, {}>'.: error TS2339: Property 'toHaveText' does not exist on type 'MakeMatchers<void, Locator | undefined, {}>'.
  • src/components/select/test/select-keyboard.ct.ts(314,48): error TS2339: Property 'toBeFocused' does not exist on type 'MakeMatchers<void, Locator | undefined, {}>'.: error TS2339: Property 'toBeFocused' does not exist on type 'MakeMatchers<void, Locator | undefined, {}>'.
  • src/components/select/test/select-keyboard.ct.ts(315,48): error TS2339: Property 'toHaveText' does not exist on type 'MakeMatchers<void, Locator | undefined, {}>'.: error TS2339: Property 'toHaveText' does not exist on type 'MakeMatchers<void, Locator | undefined, {}>'.
  • src/components/select/test/select-keyboard.ct.ts(339,49): error TS2339: Property 'toBeFocused' does not exist on type 'MakeMatchers<void, Locator | undefined, {}>'.: error TS2339: Property 'toBeFocused' does not exist on type 'MakeMatchers<void, Locator | undefined, {}>'.
  • src/components/select/test/select-keyboard.ct.ts(340,49): error TS2339: Property 'toHaveText' does not exist on type 'MakeMatchers<void, Locator | undefined, {}>'.: error TS2339: Property 'toHaveText' does not exist on type 'MakeMatchers<void, Locator | undefined, {}>'.
  • src/components/select/test/select-keyboard.ct.ts(345,48): error TS2339: Property 'toBeFocused' does not exist on type 'MakeMatchers<void, Locator | undefined, {}>'.: error TS2339: Property 'toBeFocused' does not exist on type 'MakeMatchers<void, Locator | undefined, {}>'.
  • src/components/select/test/select-keyboard.ct.ts(346,48): error TS2339: Property 'toHaveText' does not exist on type 'MakeMatchers<void, Locator | undefined, {}>'.: error TS2339: Property 'toHaveText' does not exist on type 'MakeMatchers<void, Locator | undefined, {}>'.
  • src/components/select/test/select-keyboard.ct.ts(370,48): error TS2339: Property 'toBeFocused' does not exist on type 'MakeMatchers<void, Locator | undefined, {}>'.: error TS2339: Property 'toBeFocused' does not exist on type 'MakeMatchers<void, Locator | undefined, {}>'.
  • src/components/select/test/select-keyboard.ct.ts(371,48): error TS2339: Property 'toHaveText' does not exist on type 'MakeMatchers<void, Locator | undefined, {}>'.: error TS2339: Property 'toHaveText' does not exist on type 'MakeMatchers<void, Locator | undefined, {}>'.
  • src/components/select/test/select-keyboard.ct.ts(400,48): error TS2339: Property 'toBeFocused' does not exist on type 'MakeMatchers<void, Locator | undefined, {}>'.: error TS2339: Property 'toBeFocused' does not exist on type 'MakeMatchers<void, Locator | undefined, {}>'.
  • src/components/select/test/select-keyboard.ct.ts(401,48): error TS2339: Property 'toHaveText' does not exist on type 'MakeMatchers<void, Locator | undefined, {}>'.: error TS2339: Property 'toHaveText' does not exist on type 'MakeMatchers<void, Locator | undefined, {}>'.
  • src/components/select/test/select-keyboard.ct.ts(423,49): error TS2339: Property 'toHaveText' does not exist on type 'MakeMatchers<void, Locator | undefined, {}>'.: error TS2339: Property 'toHaveText' does not exist on type 'MakeMatchers<void, Locator | undefined, {}>'.
  • src/components/select/test/select-keyboard.ct.ts(424,49): error TS2339: Property 'toBeFocused' does not exist on type 'MakeMatchers<void, Locator | undefined, {}>'.: error TS2339: Property 'toBeFocused' does not exist on type 'MakeMatchers<void, Locator | undefined, {}>'.
  • src/components/select/test/select-keyboard.ct.ts(425,53): error TS2339: Property 'toBeFocused' does not exist on type '(MakeMatchers<void, Locator | undefined, {}> & LocatorAssertions) | (MakeMatchers<void, Locator | undefined, {}> & GenericAssertions<...>)'.: error TS2339: Property 'toBeFocused' does not exist on type '(MakeMatchers<void, Locator | undefined, {}> & LocatorAssertions) | (MakeMatchers<void, Locator | undefined, {}> & GenericAssertions<...>)'.
  • src/components/select/test/select-keyboard.ct.ts(430,48): error TS2339: Property 'toHaveText' does not exist on type 'MakeMatchers<void, Locator | undefined, {}>'.: error TS2339: Property 'toHaveText' does not exist on type 'MakeMatchers<void, Locator | undefined, {}>'.
  • src/components/select/test/select-keyboard.ct.ts(431,52): error TS2339: Property 'toBeFocused' does not exist on type '(MakeMatchers<void, Locator | undefined, {}> & LocatorAssertions) | (MakeMatchers<void, Locator | undefined, {}> & GenericAssertions<...>)'.: error TS2339: Property 'toBeFocused' does not exist on type '(MakeMatchers<void, Locator | undefined, {}> & LocatorAssertions) | (MakeMatchers<void, Locator | undefined, {}> & GenericAssertions<...>)'.
  • src/components/select/test/select-keyboard.ct.ts(432,48): error TS2339: Property 'toBeFocused' does not exist on type 'MakeMatchers<void, Locator | undefined, {}>'.: error TS2339: Property 'toBeFocused' does not exist on type 'MakeMatchers<void, Locator | undefined, {}>'.
  • src/components/select/test/select-keyboard.ct.ts(451,49): error TS2339: Property 'toHaveText' does not exist on type 'MakeMatchers<void, Locator | undefined, {}>'.: error TS2339: Property 'toHaveText' does not exist on type 'MakeMatchers<void, Locator | undefined, {}>'.
  • src/components/select/test/select-keyboard.ct.ts(452,49): error TS2339: Property 'toBeFocused' does not exist on type 'MakeMatchers<void, Locator | undefined, {}>'.: error TS2339: Property 'toBeFocused' does not exist on type 'MakeMatchers<void, Locator | undefined, {}>'.
  • src/components/select/test/select-keyboard.ct.ts(480,48): error TS2339: Property 'toBeFocused' does not exist on type 'MakeMatchers<void, Locator | undefined, {}>'.: error TS2339: Property 'toBeFocused' does not exist on type 'MakeMatchers<void, Locator | undefined, {}>'.
  • src/components/select/test/select-keyboard.ct.ts(481,48): error TS2339: Property 'toHaveText' does not exist on type 'MakeMatchers<void, Locator | undefined, {}>'.: error TS2339: Property 'toHaveText' does not exist on type 'MakeMatchers<void, Locator | undefined, {}>'.

@nuke-ellington nuke-ellington marked this pull request as ready for review January 10, 2025 10:51
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.

3 participants