mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-08 09:02:24 +08:00
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
17 lines
459 B
TypeScript
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');
|
|
});
|
|
});
|