-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10702 from storybookjs/tech/ci-example-overhaul-c…
…lean Tech/ci example overhaul clean
- Loading branch information
Showing
61 changed files
with
1,732 additions
and
836 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,5 +28,5 @@ a { | |
</style> | ||
|
||
<div id="app"> | ||
<h1>Welcome to Storybook for Marko</h1> | ||
<h1>Welcome to storybook</h1> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
declare module '@storybook/core/*'; | ||
declare module 'global'; | ||
declare module 'fs-extra'; | ||
|
||
// will be provided by the webpack define plugin | ||
declare var NODE_ENV: string | undefined; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,5 @@ | ||
{} | ||
{ | ||
"defaultCommandTimeout": 20000, | ||
"requestTimeout": 20000, | ||
"responseTimeout": 60000 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { visit, clickAddon } from '../helper'; | ||
|
||
describe('addon-action', () => { | ||
before(() => { | ||
visit(); | ||
cy.get('#button').click(); | ||
}); | ||
|
||
it('should trigger an action', () => { | ||
// click on the button | ||
cy.get('#button--with-some-emoji-and-action').click(); | ||
|
||
// assert url changes | ||
cy.url().should('include', 'path=/story/button--with-some-emoji-and-action'); | ||
|
||
// check for selected element | ||
cy.get('#button--with-some-emoji-and-action').should('have.class', 'selected'); | ||
|
||
// check for content | ||
cy.getStoryElement().find('button').click(); | ||
|
||
// click on addon | ||
clickAddon('Actions'); | ||
|
||
// TODO @yannbf improve tab identifier on addons | ||
// get the logs | ||
cy.get('#storybook-panel-root') | ||
.contains(/This was clicked/) | ||
.should('be.visible'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
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'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
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'); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.