├── .gitignore
├── LICENSE
├── README.md
├── hp.jpg
├── package-lock.json
├── package.json
├── public
├── favicon.ico
├── index.html
└── manifest.json
└── src
├── .gitkeep
├── App.css
├── App.js
├── App.test.js
├── ButtonWithTextInput.js
├── ButtonWithTextInput.test.js
├── __snapshots__
└── ButtonWithTextInput.test.js.snap
├── elements
├── CustomButton.css
├── CustomButton.js
├── CustomButton.test.js
├── CustomTextInput.css
├── CustomTextInput.js
├── CustomTextInput.test.js
├── __snapshots__
│ ├── CustomButton.test.js.snap
│ └── CustomTextInput.test.js.snap
└── index.js
├── index.css
├── index.js
└── setupTests.js
/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/ignore-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 |
6 | # testing
7 | /coverage
8 |
9 | # production
10 | /build
11 |
12 | # misc
13 | .DS_Store
14 | .env.local
15 | .env.development.local
16 | .env.test.local
17 | .env.production.local
18 | .vscode
19 |
20 | npm-debug.log*
21 | yarn-debug.log*
22 | yarn-error.log*
23 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2018 Mihail Gaberov
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # UI (React) Unit Testing
2 | "What should we test in our React components" - working examples.
3 |
4 | You can view the [presentation here](http://mihailgaberov.github.io/testing-reactjs-presentation) and the demo app [here](http://mihailgaberov.github.io/testing-reactjs-presentation-examples).
5 |
6 | 
7 |
--------------------------------------------------------------------------------
/hp.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mihailgaberov/testing-reactjs-examples/d63c1cca6df243f185330df6c9ddf5bdceeeebc5/hp.jpg
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "testing-reactjs-examples",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "react": "^16.14.0",
7 | "react-dom": "^16.14.0",
8 | "react-scripts": "5.0.1"
9 | },
10 | "scripts": {
11 | "start": "react-scripts start",
12 | "build": "react-scripts build",
13 | "test": "react-scripts test --env=jsdom",
14 | "eject": "react-scripts eject"
15 | },
16 | "devDependencies": {
17 | "enzyme": "^3.3.0",
18 | "enzyme-adapter-react-16": "^1.15.6",
19 | "enzyme-to-json": "^3.3.4",
20 | "sinon": "^5.1.0"
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mihailgaberov/testing-reactjs-examples/d63c1cca6df243f185330df6c9ddf5bdceeeebc5/public/favicon.ico
--------------------------------------------------------------------------------
/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |