mirror of
https://github.com/storybookjs/storybook.git
synced 2025-03-21 05:02:39 +08:00
36 lines
915 B
TypeScript
36 lines
915 B
TypeScript
import { visit } from '../helper';
|
|
|
|
describe('Basic Flow', () => {
|
|
before(() => {
|
|
visit();
|
|
});
|
|
|
|
it('should load welcome flow', () => {
|
|
// assert url changes
|
|
cy.url().should('include', 'path=/story/welcome--to-storybook');
|
|
|
|
// check for selected element
|
|
cy.get('#welcome--to-storybook').should('have.class', 'selected');
|
|
|
|
// check for content
|
|
cy.getStoryElement().should('contain.text', 'Welcome to storybook');
|
|
});
|
|
|
|
describe('Button story', () => {
|
|
before(() => {
|
|
cy.get('#button').click();
|
|
});
|
|
|
|
it('should be visited succesfully', () => {
|
|
// assert url changes
|
|
cy.url().should('include', 'path=/story/button--text');
|
|
|
|
// check for selected element
|
|
cy.get('#button--text').should('have.class', 'selected');
|
|
|
|
// check for content
|
|
cy.getStoryElement().find('button').should('contain.text', 'Hello Button');
|
|
});
|
|
});
|
|
});
|