storybook/cypress/generated/addon-link.spec.ts
2020-05-09 11:34:04 +02:00

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');
});
});