-
Notifications
You must be signed in to change notification settings - Fork 450
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
feat(sanity): add CapabilityGate
component
#8621
feat(sanity): add CapabilityGate
component
#8621
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
2 Skipped Deployments
|
This stack of pull requests is managed by Graphite. Learn more about stacking. |
No changes to documentation |
⚡️ Editor Performance ReportUpdated Thu, 06 Mar 2025 17:09:53 GMT
Detailed information🏠 Reference resultThe performance result of
🧪 Experiment resultThe performance result of this branch
📚 Glossary
|
Component Testing Report Updated Mar 6, 2025 5:15 PM (UTC) ❌ Failed Tests (2) -- expand for details
|
e23ed66
to
f6ea950
Compare
6c79dc5
to
455d288
Compare
0774445
to
5785e3e
Compare
f6ea950
to
f4321f9
Compare
5785e3e
to
2798b2d
Compare
54002b7
to
19b1d80
Compare
f4321f9
to
d1fef34
Compare
Coverage Report
File Coverage
|
87e5ac2
to
b2df74b
Compare
19b1d80
to
daf24a6
Compare
{wrapper}, | ||
) | ||
|
||
expect(screen.getByTestId('user-menu')).toBeTruthy() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT: .toBeInTheDocument()
rather than .toBeTruthy()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Curious: is that just a style preference?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Functionally, in this case there's no difference - but if you were using queryByTestId
instead then that throws instead of returns null - so mostly around consistency of approach I suppose. toBeTruthy/Falsy
I feel are best avoided in many cases for the additional false positives they might capture eg ""
0
- again not relevant in this case where you are returning the element
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for explaining. Makes sense! 🙂 I'm actually usually very opposed to truthy/falsey checks, for the reasons you stated.
daf24a6
to
b0c005a
Compare
b2df74b
to
34943ef
Compare
34943ef
to
0a6f7ba
Compare
0a6f7ba
to
0e446c7
Compare
Merge activity
|
Description
This branch adds a
CapabilityGate
component that can be used to conditionally render other components based on the current rendering context. For example, to prevent the global user menu from rendering when the rendering context provides this capability. You can see this exact scenario in #8591.What to review
Any issues with the component implementation?
Testing
There are added unit tests, and you can see the changes in action in #8591.