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: get host component names on render (modified) #1306

Merged
merged 5 commits into from
Feb 8, 2023

Conversation

mdjastrzebski
Copy link
Member

@mdjastrzebski mdjastrzebski commented Feb 3, 2023

This is based on #1304, but since that was external PR I've moved it as internal repo PR with added proposed changes:

  • extract detectHostElementNames from getHostComponents()
  • create configureHostElementNamesIfNeeded to be called in render
  • simplify getHostElementNames.

Summary
Fixes #1302 by detecting host component names in render to prevent running auto detection in external act which fails for some users.

Test plan
Added a test case where I call getHostComponentNames wrapped in act after a render and expect it does not throw

@mdjastrzebski mdjastrzebski changed the title Fix/get host component names on render fix: get host component names on render (modified) Feb 3, 2023
@mdjastrzebski
Copy link
Member Author

@pierrezimmermannbam @MattAgn In order to simplify code, reduce error handling I've added back lazy detection to getHostComponentNames(). Pls take another look at this PR.

@codecov
Copy link

codecov bot commented Feb 8, 2023

Codecov Report

Base: 95.13% // Head: 96.07% // Increases project coverage by +0.93% 🎉

Coverage data is based on head (47c8506) compared to base (9019eed).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1306      +/-   ##
==========================================
+ Coverage   95.13%   96.07%   +0.93%     
==========================================
  Files          46       49       +3     
  Lines        3205     3308     +103     
  Branches      483      497      +14     
==========================================
+ Hits         3049     3178     +129     
+ Misses        156      130      -26     
Impacted Files Coverage Δ
src/helpers/host-component-names.tsx 100.00% <100.00%> (ø)
src/render.tsx 100.00% <100.00%> (ø)
src/queries/a11yState.ts 100.00% <0.00%> (ø)
src/queries/a11yValue.ts 100.00% <0.00%> (ø)
src/queries/labelText.ts 100.00% <0.00%> (ø)
src/helpers/matchers/matchTextContent.ts 100.00% <0.00%> (ø)
src/helpers/matchers/matchLabelText.ts 100.00% <0.00%> (ø)
src/helpers/deprecation.ts 100.00% <0.00%> (ø)
src/helpers/query-name.ts 100.00% <0.00%> (ø)
src/queries/text.ts 97.89% <0.00%> (+0.22%) ⬆️
... and 1 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@mdjastrzebski mdjastrzebski merged commit 2b5d0d2 into main Feb 8, 2023
@mdjastrzebski mdjastrzebski deleted the fix/getHostComponentNamesOnRender branch February 8, 2023 14:09
@idrissakhi
Copy link

well done 👍

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.

[1.15.1] new act implementation is causing actual tests to fail
4 participants