This repository has been archived by the owner on Oct 21, 2020. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Testing components
- Loading branch information
Showing
13 changed files
with
2,239 additions
and
250 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 |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = 'test-file-stub'; |
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 @@ | ||
module.exports = {}; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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 |
---|---|---|
|
@@ -44,6 +44,12 @@ | |
"storybook": "start-storybook -p 9001 -c src/.storybook", | ||
"watch-css": "npm run build-css && node-sass-chokidar src/components/ -o src/components/ --watch --recursive" | ||
}, | ||
"jest": { | ||
"moduleNameMapper": { | ||
"\\.(css|less|sass|scss)$": "<rootDir>/__mocks__/styleMock.js", | ||
"\\.(gif|ttf|eot|svg)$": "identity-obj-proxy" | ||
} | ||
}, | ||
"storybook-deployer": { | ||
"gitUsername": "piyush97", | ||
"gitEmail": "[email protected]", | ||
|
@@ -87,6 +93,7 @@ | |
"eslint-watch": "^6.0.0", | ||
"extract-text-webpack-plugin": "^4.0.0-beta.0", | ||
"husky": "^1.2.0", | ||
"identity-obj-proxy": "^3.0.0", | ||
"jest": "^24.8.0", | ||
"lint-staged": "^8.1.0", | ||
"mini-css-extract-plugin": "^0.8.0", | ||
|
@@ -96,9 +103,9 @@ | |
"prettier": "^1.18.2", | ||
"pretty-quick": "^1.11.1", | ||
"prop-types": "^15.7.2", | ||
"react": "^16.8.6", | ||
"react-dom": "^16.8.6", | ||
"react-test-renderer": "^16.9.0", | ||
"react": "^16.8.3", | ||
"react-dom": "^16.8.3", | ||
"react-test-renderer": "^16.8.6", | ||
"sass-loader": "^7.1.0", | ||
"storybook-addon-jsx": "^7.1.5", | ||
"style-loader": "^1.0.0", | ||
|
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,22 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`box default test case 1`] = ` | ||
<div | ||
className="Primary" | ||
style={ | ||
Object { | ||
"color": "white", | ||
"margin": "2.5em", | ||
"padding": "2em", | ||
"textColor": Object { | ||
"textColor": "white", | ||
}, | ||
} | ||
} | ||
> | ||
This is: | ||
Primary | ||
with textColor: | ||
white | ||
</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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import React from 'react'; | ||
import renderer from 'react-test-renderer'; | ||
import Box from './index'; | ||
|
||
test('box default test case',()=>{ | ||
const component = renderer.create( | ||
<Box color="Primary" p={2} m={2.5} /> | ||
); | ||
const tree = component.toJSON(); | ||
expect(tree).toMatchSnapshot(); | ||
}); | ||
|
Oops, something went wrong.