mirror of
https://github.com/storybookjs/storybook.git
synced 2025-03-21 05:02:39 +08:00
26 lines
712 B
TypeScript
26 lines
712 B
TypeScript
import { visit, clickAddon } from '../helper';
|
|
|
|
describe('addon-link', () => {
|
|
before(() => {
|
|
visit();
|
|
cy.get('#button').click();
|
|
});
|
|
|
|
it('should redirect to another story', () => {
|
|
// click on the button
|
|
cy.get('#button--button-with-link-to-another-story').click();
|
|
|
|
// assert url changes
|
|
cy.url().should('include', 'path=/story/button--button-with-link-to-another-story');
|
|
|
|
// check for selected element
|
|
cy.get('#button--button-with-link-to-another-story').should('have.class', 'selected');
|
|
|
|
// check for content
|
|
cy.getStoryElement().find('button').click();
|
|
|
|
// assert url changes
|
|
cy.url().should('include', 'path=/story/welcome--to-storybook');
|
|
});
|
|
});
|