mirror of
https://github.com/storybookjs/storybook.git
synced 2025-03-17 05:02:23 +08:00
Ensure parent is expanded before trying to click an item.
This commit is contained in:
parent
ac07320627
commit
eb88960fba
@ -98,8 +98,10 @@ Cypress.Commands.add('navigateToStory', (kind, name) => {
|
||||
cy.log(`navigateToStory ${kind} ${name}`);
|
||||
|
||||
if (name !== 'page') {
|
||||
// Section can be collapsed, click twice ensure expansion
|
||||
cy.get(`#${kindId}`).click();
|
||||
// Section might be collapsed
|
||||
cy.get(`#${kindId}`).then(($item) => {
|
||||
if ($item.getAttribute('aria-expanded') === 'false') $item.click();
|
||||
});
|
||||
}
|
||||
cy.get(storyLinkId).click();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user