Skip to content

Commit

Permalink
It's not so easy to differentiate single story entries
Browse files Browse the repository at this point in the history
  • Loading branch information
tmeasday committed Jul 1, 2022
1 parent 6cfdf34 commit cbf9125
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,17 +97,14 @@ Cypress.Commands.add('navigateToStory', (kind, name) => {
const storyLinkId = `#${kindId}--${storyId}`;
cy.log(`navigateToStory ${kind} ${name}`);

// docs-only stories
if (name !== 'docs') {
// Section might be collapsed
cy.get(`#${kindId}`).then(async ($item) => {
if ($item.attr('aria-expanded') === 'false') {
await $item.click();
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(300);
}
});
}
// Section might be collapsed
cy.get(`#${kindId}`).then(async ($item) => {
if ($item.attr('aria-expanded') === 'false') {
await $item.click();
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(300);
}
});

cy.get(storyLinkId).click({ force: true });

Expand Down

0 comments on commit cbf9125

Please sign in to comment.