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(Select): enforce content update after render #156

Merged
merged 10 commits into from
Nov 15, 2023
Merged

Conversation

Lodin
Copy link
Contributor

@Lodin Lodin commented Nov 2, 2023

Fixes #148.

Also this PR simplifies the testing approach (only for Select component) to avoid weird failures.

@Lodin Lodin requested review from vursen and web-padawan November 2, 2023 12:57
src/Select.tsx Outdated Show resolved Hide resolved
@Lodin Lodin requested a review from vursen November 2, 2023 13:06
src/Select.tsx Show resolved Hide resolved
@Lodin
Copy link
Contributor Author

Lodin commented Nov 3, 2023

@vursen, is this expression expected to work?

render(<Select renderer={Renderer} value="bar" />);
expect(document.querySelector('vaadin-select-value-button')).to.have.text('Bar');

render(<Select renderer={Renderer} value="foo" />);
expect(document.querySelector('vaadin-select-value-button')).to.have.text('Foo');

@vursen
Copy link
Contributor

vursen commented Nov 3, 2023

is this expression expected to work?

I believe so, unless React renders this asynchronously.

@Lodin Lodin requested a review from vursen November 7, 2023 11:28
src/Select.tsx Show resolved Hide resolved
test/Select.spec.tsx Outdated Show resolved Hide resolved
test/Select.spec.tsx Outdated Show resolved Hide resolved
Co-authored-by: Sergey Vinogradov <mr.vursen@gmail.com>
@Lodin Lodin enabled auto-merge (squash) November 15, 2023 13:02
@codecov-commenter
Copy link

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (e131230) 99.36% compared to head (fa15b6a) 98.22%.

Files Patch % Lines
src/utils/useMergedRefs.ts 66.66% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #156      +/-   ##
==========================================
- Coverage   99.36%   98.22%   -1.15%     
==========================================
  Files          24       25       +1     
  Lines         158      169      +11     
  Branches       13       16       +3     
==========================================
+ Hits          157      166       +9     
- Misses          0        1       +1     
- Partials        1        2       +1     
Flag Coverage Δ
unittests 98.22% <81.81%> (-1.15%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

Comment on lines +540 to +541
"./SideNav": "./SideNav.js",
"./SideNavItem": "./SideNavItem.js",
Copy link
Contributor

@vursen vursen Nov 15, 2023

Choose a reason for hiding this comment

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

Were these SideNav exports intentionally included in this PR? Looks like an unrelated change.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

🤔

Copy link
Contributor Author

@Lodin Lodin Nov 15, 2023

Choose a reason for hiding this comment

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

I guess, it was done by a script, because we already have SideNav on line 421, but no supporting export on 538. I would suggest to leave it here because we would need to include it anyway (and probably it's gonna be generated on each script run).

@Lodin Lodin merged commit fe90a52 into main Nov 15, 2023
1 check passed
@Lodin Lodin deleted the fix/select-empty-default branch November 15, 2023 13:33
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.

Select is not showing its value when using a renderer
3 participants