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

fix: Fix test-utils wrappers inheritance #3287

Merged
merged 1 commit into from
Feb 13, 2025

Conversation

just-boris
Copy link
Member

@just-boris just-boris commented Feb 12, 2025

Description

Fix this use-case

createWrapper()
    .findAttributeEditor()
    .findRow(1)
    .findColumnLayout() // wrong - there is no column layout there, but types allow that
    .toSelector()

Three cases will remain unfixed after this change

DropdownWrapper – there is too much code assuming it is an element wrapper, it requires a fix on its own

export default class DropdownWrapper extends ElementWrapper {

TooltipWrapper - this class is empty, unclear why it exists at all

export default class TooltipWrapper extends ElementWrapper {

OptionsList – same, also empty

export default class OptionsListWrapper extends ElementWrapper {

How has this been tested?

  • PR build
  • Dry-run to live 7232687283 (to my big surprise, it passes)
Review checklist

The following items are to be evaluated by the author(s) and the reviewer(s).

Correctness

  • Changes include appropriate documentation updates.
  • Changes are backward-compatible if not indicated, see CONTRIBUTING.md.
  • Changes do not include unsupported browser features, see CONTRIBUTING.md.
  • Changes were manually tested for accessibility, see accessibility guidelines.

Security

Testing

  • Changes are covered with new/existing unit tests?
  • Changes are covered with new/existing integration tests?

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Copy link

codecov bot commented Feb 12, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.41%. Comparing base (9976a86) to head (8dd76c1).
Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3287   +/-   ##
=======================================
  Coverage   96.41%   96.41%           
=======================================
  Files         791      791           
  Lines       22563    22563           
  Branches     7726     7786   +60     
=======================================
  Hits        21755    21755           
- Misses        754      801   +47     
+ Partials       54        7   -47     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@just-boris just-boris force-pushed the test-utils-component-wrapper branch from f83cfce to 0157dbb Compare February 12, 2025 15:04
Comment on lines -572 to +580
const nextInput = wrapper.findRow(1)!.findAutosuggest()!.findNativeInput().getElement();
const nextInput = wrapper
.findRow(1)!
.findField(1)!
.findControl()!
.findAutosuggest()!
.findNativeInput()
.getElement();
Copy link
Member Author

Choose a reason for hiding this comment

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

Bonus effect of this improvement. Now we strictly target the first column in a row and not an autosuggest in any column

@just-boris just-boris force-pushed the test-utils-component-wrapper branch from dc69ef8 to 8dd76c1 Compare February 12, 2025 16:12
@just-boris just-boris marked this pull request as ready for review February 12, 2025 16:32
@just-boris just-boris requested a review from a team as a code owner February 12, 2025 16:32
@just-boris just-boris requested review from johannes-weber and removed request for a team February 12, 2025 16:32
@just-boris just-boris added this pull request to the merge queue Feb 13, 2025
Merged via the queue into main with commit f8f32c5 Feb 13, 2025
40 checks passed
@just-boris just-boris deleted the test-utils-component-wrapper branch February 13, 2025 12:54
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.

2 participants