This repository has been archived by the owner on Mar 4, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix focus styles * add static Item to Tree * add screener tests for focus * fix selector * fix the selector better * removed unnecessary static item * change selector in screener tests * move all into a single test * change the test to allow all kb interactions * revert unneeded change * changelog (cherry picked from commit 2a9989e)
- Loading branch information
1 parent
93cdff7
commit ec58463
Showing
4 changed files
with
33 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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
26 changes: 26 additions & 0 deletions
26
docs/src/examples/components/Tree/Types/TreeExample.shorthand.steps.ts
This file contains 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,26 @@ | ||
import { TreeItem, TreeTitle } from '@stardust-ui/react' | ||
|
||
const selectors = { | ||
treeItem: (itemIndex: number) => `.${TreeItem.className}:nth-of-type(${itemIndex})`, | ||
treeTitle: (itemIndex: number) => | ||
`.${TreeItem.className}:nth-of-type(${itemIndex}) .${TreeTitle.className}`, | ||
} | ||
|
||
const config: ScreenerTestsConfig = { | ||
themes: ['teams', 'teamsDark', 'teamsHighContrast'], | ||
steps: [ | ||
(builder, keys) => | ||
builder | ||
.click(selectors.treeTitle(1)) | ||
.snapshot('Focus on click subtree') | ||
.keys(selectors.treeItem(2), keys.downArrow) | ||
.snapshot('Focus on keyboard subtree') | ||
.click(selectors.treeTitle(2)) | ||
.keys(selectors.treeItem(2), keys.downArrow) | ||
.snapshot('Focus on keyboard leaf') | ||
.click(selectors.treeTitle(4)) | ||
.snapshot('Focus on click leaf'), | ||
], | ||
} | ||
|
||
export default config |
This file contains 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 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