-
Notifications
You must be signed in to change notification settings - Fork 273
Add alias to hidden in query options #1220
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
Changes from 4 commits
4b48614
e60d4a2
891b293
cb569a2
dfcd2ed
b4bfad2
d0592ad
5d23ae3
9835e77
6a1cd36
6bf81aa
a7c9c76
c86b75c
fa35bc9
b891395
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -239,9 +239,18 @@ test('byA11yState queries support hidden option', () => { | |
|
||
expect(getByA11yState({ expanded: false })).toBeTruthy(); | ||
expect(getByA11yState({ expanded: false }, { hidden: true })).toBeTruthy(); | ||
expect( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. style: in our tests (also in other test files) I think it would be enough to use recommended There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Or in case you find it useful the current way, just put the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. extracting them in another test file sounds good :) (helped me find a bug in the process) |
||
getByA11yState({ expanded: false }, { includeHidden: true }) | ||
).toBeTruthy(); | ||
|
||
expect(queryByA11yState({ expanded: false }, { hidden: false })).toBeFalsy(); | ||
expect(() => | ||
getByA11yState({ expanded: false }, { hidden: false }) | ||
).toThrow(); | ||
expect( | ||
queryByA11yState({ expanded: false }, { includeHidden: false }) | ||
).toBeFalsy(); | ||
expect(() => | ||
getByA11yState({ expanded: false }, { includeHidden: false }) | ||
).toThrow(); | ||
}); |
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.
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.
i wanted to avoid nested operators to maximise readibility, do you find it more readable your way?
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.
Yes, I find it much more readable, as a single nullish coalescing operator. Having it as separate intermediate vars would be useful if it used a mix of two operators (like
&&
and||
) with different precedence, etc. In case all vars use the same operator, I found putting it together removes the question why are there some intermediate variables :-)