-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Commit new version! * v3.0.0-2 * improve storybook * try to fix type exports * v3.0.0-3 * add missing warning dependency * v3.0.0-4 * adding cypress, removing some jest tests * update readme with directions to v2 docs Co-authored-by: Rogin Farrer <rfarrer@Rogins-MacBook-Pro.local>
- Loading branch information
1 parent
34e296e
commit add3ca7
Showing
85 changed files
with
16,061 additions
and
5,565 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
*.log | ||
.DS_Store | ||
node_modules | ||
.cache | ||
dist | ||
.docz/ | ||
.vscode/ | ||
coverage | ||
.eslintcache |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 @@ | ||
import 'cypress-storybook/react'; |
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,29 @@ | ||
module.exports = { | ||
stories: ['../stories/**/*.stories.(ts|tsx)'], | ||
addons: [ | ||
'@storybook/addon-actions', | ||
'@storybook/addon-links', | ||
'@storybook/addon-a11y', | ||
'@storybook/addon-storysource', | ||
], | ||
webpackFinal: async config => { | ||
config.module.rules.push({ | ||
test: /\.(ts|tsx)$/, | ||
use: [ | ||
{ | ||
loader: require.resolve('ts-loader'), | ||
options: { | ||
transpileOnly: true, | ||
}, | ||
}, | ||
{ | ||
loader: require.resolve('react-docgen-typescript-loader'), | ||
}, | ||
], | ||
}); | ||
|
||
config.resolve.extensions.push('.ts', '.tsx'); | ||
|
||
return config; | ||
}, | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"baseUrl": "http://localhost:6006" | ||
} |
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,6 @@ | ||
{ | ||
"plugins": ["cypress"], | ||
"env": { | ||
"cypress/globals": true | ||
} | ||
} |
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,5 @@ | ||
{ | ||
"name": "Using fixtures to represent data", | ||
"email": "hello@cypress.io", | ||
"body": "Fixtures are a great way to mock data for responses to routes" | ||
} |
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,49 @@ | ||
import 'cypress-storybook/cypress'; | ||
|
||
describe('My First Test', function() { | ||
it('Does not do much!', function() { | ||
expect(true).to.equal(true); | ||
}); | ||
}); | ||
|
||
describe('My First Test', function() { | ||
it('Does not do much!', function() { | ||
expect(true).to.equal(false); | ||
}); | ||
}); | ||
|
||
describe('My First Test', function() { | ||
it('clicks the link "type"', function() { | ||
cy.visit('https://example.cypress.io'); | ||
|
||
cy.contains('type').click(); | ||
}); | ||
}); | ||
|
||
describe('RC', () => { | ||
// Note the use of `before` | ||
before(() => { | ||
// Visit the storybook iframe page once per file | ||
cy.visitStorybook(); | ||
}); | ||
|
||
// Note the use of `beforeEach` | ||
beforeEach(() => { | ||
// The first parameter is the category. This is the `title` in CSF or the value in `storiesOf` | ||
// The second parameter is the name of the story. This is the name of the function in CSF or the value in the `add` | ||
// This does not refresh the page, but will unmount any previous story and use the Storybook Router API to render a fresh new story | ||
cy.loadStory('React-Collapsed', 'Uncontrolled'); | ||
}); | ||
|
||
it('toggles open and close the panel', () => { | ||
cy.contains('Close').should('exist'); | ||
cy.contains('Open').should('not.exist'); | ||
cy.contains('In the morning').should('be.visible'); | ||
|
||
cy.contains('Close').click(); | ||
|
||
cy.contains('Close').should('not.exist'); | ||
cy.contains('Open').should('exist'); | ||
cy.contains('In the morning').should('not.be.visible'); | ||
}); | ||
}); |
Oops, something went wrong.