-
Notifications
You must be signed in to change notification settings - Fork 469
Getroles logroles #285
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 34 commits into
testing-library:master
from
michaellasky:getroles-logroles
Jun 24, 2019
Merged
Getroles logroles #285
Changes from 32 commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
b6ce430
Added npm package lodash.merge
michaellasky c5abc46
Add `getRoles` and `logRoles` utilities #282
michaellasky eea0dfe
Updated logRole test to not rely on snapshot
michaellasky 608681d
Added role-helpers export to index.js
michaellasky 8c4ca7c
Changed formatting of logRoles
michaellasky cf3c1c5
Removed some tests that weren't needed
michaellasky b179086
Refactored getRoles and updated related tests
michaellasky 556857f
Removed export of buildElementRoleList
michaellasky aaf0254
Removed lodash.merge dependency
michaellasky f362406
Minor: removed a useless -1
michaellasky cb21991
Minor: statement no longer had to be temp literal
michaellasky ee95972
Reasability / sanity pass
michaellasky fbd7e2b
Initial value for reducer switched to array
michaellasky 22dbce9
Fixed bug with node selectors on specificity > 0 nodes
michaellasky 2814797
Added the role-helpers snapshot
michaellasky 7b5ecb1
Added basic test coverage for getImplicitAriaRole
michaellasky e96cbbd
Removed un-needed branch
michaellasky afd42c0
Minor: Added a cleanup afterEach test
michaellasky 76c2d3f
Removed unneeded elementRoleMap
michaellasky a5a81c8
getRoles now handles muultiple implicit roles
michaellasky 6ad8ef9
Added npm package jest-serializer-ansi
michaellasky 02ab1b9
Snapshot now uses jest-serilizer-ansi
michaellasky e452465
Tests now use jest-serilizer-ansi
michaellasky de5bf5c
Switched '#' to '-' in the output of logRoles
michaellasky 2ecda86
role-helpers test minor change to reduce LOC
michaellasky 0a87a5d
Removed elementRoleList from role-helpers export
michaellasky b9a16e1
Made public-api exports from role-helpers spcific
michaellasky 3c5b545
Minor: made testids more consistent
michaellasky f148198
Minor: '\n' handling is more consistent in logRoles
michaellasky 5cce4cc
Merge branch 'master' into getroles-logroles
michaellasky 93f9530
Added TS definitions for getRoles, logRoles
michaellasky f1421ce
Merge branch 'master' of https://github.com/testing-library/dom-testi…
michaellasky 593c33f
Changed logRoles formatting
michaellasky f95b293
Fixed spelling error
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,163 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`logRoles logs expected roles for various dom nodes 1`] = ` | ||
"region ------------------------------------ | ||
|
||
<section | ||
data-testid="a-section" | ||
/> | ||
|
||
|
||
navigation -------------------------------- | ||
|
||
<nav | ||
data-testid="a-nav" | ||
/> | ||
|
||
|
||
heading ----------------------------------- | ||
|
||
<h1 | ||
data-testid="a-h1" | ||
/> | ||
|
||
<h2 | ||
data-testid="a-h2" | ||
/> | ||
|
||
<h3 | ||
data-testid="a-h3" | ||
/> | ||
|
||
|
||
article ----------------------------------- | ||
|
||
<article | ||
data-testid="a-article" | ||
/> | ||
|
||
|
||
command ----------------------------------- | ||
|
||
<menuitem | ||
data-testid="a-menuitem-1" | ||
/> | ||
|
||
<menuitem | ||
data-testid="a-menuitem-2" | ||
/> | ||
|
||
|
||
menuitem ---------------------------------- | ||
|
||
<menuitem | ||
data-testid="a-menuitem-1" | ||
/> | ||
|
||
<menuitem | ||
data-testid="a-menuitem-2" | ||
/> | ||
|
||
|
||
list -------------------------------------- | ||
|
||
<ul | ||
data-testid="a-list" | ||
/> | ||
|
||
<ul | ||
data-testid="b-list" | ||
/> | ||
|
||
|
||
listitem ---------------------------------- | ||
|
||
<li | ||
data-testid="a-list-item-1" | ||
/> | ||
|
||
<li | ||
data-testid="a-list-item-2" | ||
/> | ||
|
||
<li | ||
data-testid="b-list-item-1" | ||
/> | ||
|
||
<li | ||
data-testid="b-list-item-2" | ||
/> | ||
|
||
|
||
table ------------------------------------- | ||
|
||
<table | ||
data-testid="a-table" | ||
/> | ||
|
||
|
||
rowgroup ---------------------------------- | ||
|
||
<tbody | ||
data-testid="a-tbody" | ||
/> | ||
|
||
|
||
row --------------------------------------- | ||
|
||
<tr | ||
data-testid="a-row" | ||
/> | ||
|
||
|
||
cell -------------------------------------- | ||
|
||
<td | ||
data-testid="a-cell-1" | ||
/> | ||
|
||
<td | ||
data-testid="a-cell-2" | ||
/> | ||
|
||
<td | ||
data-testid="a-cell-3" | ||
/> | ||
|
||
|
||
form -------------------------------------- | ||
|
||
<form | ||
data-testid="a-form" | ||
/> | ||
|
||
|
||
radio ------------------------------------- | ||
|
||
<input | ||
data-testid="a-radio-1" | ||
type="radio" | ||
/> | ||
|
||
<input | ||
data-testid="a-radio-2" | ||
type="radio" | ||
/> | ||
|
||
|
||
textbox ----------------------------------- | ||
|
||
<input | ||
data-testid="a-input-1" | ||
type="text" | ||
/> | ||
|
||
<input | ||
data-testid="a-input-2" | ||
type="text" | ||
/> | ||
|
||
<textarea | ||
data-testid="a-textarea" | ||
/>" | ||
`; |
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
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
Oops, something went wrong.
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.
I think this looks really good. Would love to hear what others have to say though.