storybook/cypress/generated/addon-viewport.spec.ts
Gaëtan Maisse 0dabfc538e
test(e2e): add a simple test for viewport addon
CLI now generates project with `addon-essential` so it enable `addon-viewport` by default.
I added a simple test to check that viewport is properly loaded:
 - Go to Welcome Story
 - Click on Viewport button in the toolbar
 - Select "Small Mobile"
 - Check that Welcome Story is still displayed
2020-07-12 16:16:33 +02:00

17 lines
459 B
TypeScript

describe('addon-viewport', () => {
before(() => {
cy.visitStorybook();
});
it('should have viewport button in the toolbar', () => {
cy.navigateToStory('button', 'Text');
// Click on viewport button and select small mobile
cy.get('[title="Change the size of the preview"]').click();
cy.get('#mobile1').click();
// Check that Welcome story is still displayed
cy.getStoryElement().should('contain.text', 'Button');
});
});