mirror of
https://github.com/storybookjs/storybook.git
synced 2025-03-16 05:03:11 +08:00
FIX
This commit is contained in:
parent
d8317ae5ef
commit
4eeaccd929
@ -22,13 +22,10 @@ describe('Navigation', () => {
|
||||
});
|
||||
|
||||
describe('Routing', () => {
|
||||
before(() => {
|
||||
visitExample('official-storybook');
|
||||
});
|
||||
|
||||
it('should navigate to story addons-a11y-basebutton--default', () => {
|
||||
cy.get('#addons-a11y-basebutton--label').click();
|
||||
visitExample('official-storybook');
|
||||
|
||||
cy.get('#addons-a11y-basebutton--label').click();
|
||||
cy.url().should('include', 'path=/story/addons-a11y-basebutton--label');
|
||||
});
|
||||
|
||||
|
@ -38,18 +38,15 @@ Cypress.Commands.add(
|
||||
);
|
||||
|
||||
Cypress.Commands.add('preview', {}, () => {
|
||||
return cy.get(`#storybook-preview-iframe`).then({ timeout: 10000 }, (iframe) => {
|
||||
return cy.get(`#storybook-preview-iframe`).then({ timeout: 20000 }, (iframe) => {
|
||||
const content = iframe[0].contentDocument;
|
||||
const element = content !== null ? content.documentElement : null;
|
||||
|
||||
return cy
|
||||
.wrap(iframe)
|
||||
.get(iframe, { timeout: 20000 })
|
||||
.should(() => {
|
||||
expect(element).not.null;
|
||||
|
||||
if (element !== null) {
|
||||
expect(element.querySelector('#root > *')).not.null;
|
||||
}
|
||||
expect(element.querySelector('#root')).not.null;
|
||||
})
|
||||
.then(() => {
|
||||
return element.querySelector('#root');
|
||||
|
Loading…
x
Reference in New Issue
Block a user