mirror of
https://github.com/storybookjs/storybook.git
synced 2025-03-17 05:02:23 +08:00
Make sure Cypress can know when a story is selected.
This commit is contained in:
parent
651ae27b8f
commit
e9f1ded662
@ -105,7 +105,7 @@ Cypress.Commands.add('navigateToStory', (kind, name) => {
|
||||
|
||||
// assert url changes
|
||||
cy.url().should('include', `path=/story/${kindId}--${storyId}`);
|
||||
cy.get(storyLinkId).should('have.class', 'selected');
|
||||
cy.get(storyLinkId).should('have.attr', 'data-selected', 'true');
|
||||
|
||||
// A pause is good when switching stories
|
||||
// eslint-disable-next-line cypress/no-unnecessary-waiting
|
||||
|
@ -83,6 +83,8 @@ const Node = React.memo<NodeProps>(
|
||||
data-item-id={item.id}
|
||||
data-parent-id={item.parent}
|
||||
data-nodetype={item.isComponent ? 'document' : 'story'}
|
||||
data-selected={isSelected}
|
||||
data-highlighted={isHighlighted}
|
||||
data-highlightable={isDisplayed}
|
||||
depth={isOrphan ? item.depth : item.depth - 1}
|
||||
isSelected={isSelected}
|
||||
@ -105,7 +107,7 @@ const Node = React.memo<NodeProps>(
|
||||
<Action
|
||||
type="button"
|
||||
data-action="expand-all"
|
||||
data-expanded={String(isFullyExpanded)}
|
||||
data-expanded={isFullyExpanded}
|
||||
onClick={(event) => {
|
||||
event.preventDefault();
|
||||
setFullyExpanded();
|
||||
@ -126,6 +128,7 @@ const Node = React.memo<NodeProps>(
|
||||
data-item-id={item.id}
|
||||
data-parent-id={item.parent}
|
||||
data-nodetype={item.isComponent ? 'component' : 'group'}
|
||||
data-highlighted={isHighlighted}
|
||||
data-highlightable={isDisplayed}
|
||||
aria-controls={item.children && item.children[0]}
|
||||
aria-expanded={isExpanded}
|
||||
|
Loading…
x
Reference in New Issue
Block a user