-
Notifications
You must be signed in to change notification settings - Fork 727
Added docs for getRoles and logRoles #155
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
Merged
kentcdodds
merged 11 commits into
testing-library:master
from
michaellasky:pr/getroles-logroles-docs
Jul 7, 2019
Merged
Changes from 9 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
105f123
Added docs for getRoles and logRoles
michaellasky 7ec39ba
Updated logRoles output example to match new format
michaellasky 354086d
Merge branch 'master' of https://github.com/testing-library/testing-l…
michaellasky a0aed55
Changed import to @testing-library/dom
michaellasky 3390faa
Changed 'aria' to 'ARIA' in api-helpers
michaellasky da98514
Gave example HTML ul/li elements valid attributes
michaellasky 43d779e
Merge branch 'master' of https://github.com/testing-library/testing-l…
michaellasky 4f7254f
Updated another instance wrong 'dom-testing-library' import
michaellasky b026d9f
Added link to ARIA in HTML under getRoles
michaellasky d430f69
Updated getRoles and logRoles examples
michaellasky 7f3ad77
Merge branch 'master' of https://github.com/testing-library/testing-l…
michaellasky File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Since
name
isn't really a valid attribute for ul/li elements, I'd suggest removing it, so there's also less code to read in the example.What do you think about it?
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.
Oops, I didn't realize name isn't valid for ul/li.
I think we should have some attribute in there to illustrate how it prints out the attributes. Thoughts?
Assuming the above, I'll probably change name="menu" to type="circle" on the ul and give the li elements a 'value' attribute in place of 'name'.
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.
Changed here: da985145
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.
Didn't know that until I checked right now, but
type
attr on<ul>
elements is discouraged: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ul#attr-typeAlso, looks like
value
on<ul>
list items doesn't make much sense: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/li#attr-valueThere 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.
Hmm.. swing and a miss, haha
nav->ul->li was nice because it is three distinct roles in a real world kind of situation.
Maybe it doesn't matter so much if the example illustrates how the output prints attributes, so there's always the option of getting rid of the attributes in the example (as your initial suggestion).
Though I guess we could always add class and/or id attributes to illustrate a more real-world output.
I'm gonna push one more commit this evening.
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.
;) no prob.
This still makes sense to me. The main goal of the example is to illustrate what a grouping-by-role looks like, not the attribute themselves.
Thanks for your work!
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.
Ok, I've pulled the attributes off the elements completely. I agree that it's the correct call. Sorry for the delay, distracted by work/holiday.