Skip to content
This repository was archived by the owner on Nov 14, 2023. It is now read-only.

Commit d3a2fc1

Browse files
committed
feat: Add unit test
1 parent 73a3ad2 commit d3a2fc1

File tree

22 files changed

+115
-98
lines changed

22 files changed

+115
-98
lines changed

.travis.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
language: node_js
2+
node_js:
3+
- stable
4+
5+
jobs:
6+
include:
7+
- stage: "Tests"
8+
name: "Unit Tests"
9+
script: yarn && yarn test
10+
11+
branches:
12+
only:
13+
- master

docs/gatsby-config.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ module.exports = {
1111
resolve: `gatsby-source-filesystem`,
1212
options: {
1313
name: `wizard-ui`,
14-
path: Path.resolve(__dirname, `../src/lib`)
14+
path: Path.resolve(__dirname, `../src/components`)
1515
},
1616
},
1717
{
@@ -22,12 +22,7 @@ module.exports = {
2222
},
2323
},
2424
`gatsby-mdx`,
25-
{
26-
resolve: "gatsby-plugin-ts-loader",
27-
options: {
28-
tslint: true // false or exclude to disable tslint
29-
}
30-
},
25+
`gatsby-plugin-typescript`,
3126
`gatsby-plugin-react-helmet`,
3227
`gatsby-transformer-react-docgen`,
3328
`gatsby-transformer-sharp`,

docs/gatsby-node.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
*
44
* See: https://www.gatsbyjs.org/docs/node-apis/
55
*/
6-
require('ts-node/register')
76
const path = require('path');
87
const { createFilePath } = require('gatsby-source-filesystem');
98

@@ -12,7 +11,7 @@ exports.onCreateWebpackConfig = ({ actions }) => {
1211
resolve: {
1312
modules: [path.resolve(__dirname, 'node_modules')],
1413
alias: {
15-
'wizard-ui': path.resolve(__dirname, '../src/index.tsx'),
14+
'wizard-ui': path.resolve(__dirname, '../src/components'),
1615
'icomoon-icon': path.resolve (__dirname, '../src/style/icomoon/selection.json')
1716
}
1817
}

docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"gatsby-plugin-react-helmet": "^3.0.12",
1919
"gatsby-plugin-sass": "^2.0.11",
2020
"gatsby-plugin-sharp": "^2.0.37",
21-
"gatsby-plugin-ts-loader": "^0.1.0",
21+
"gatsby-plugin-typescript": "^2.0.15",
2222
"gatsby-source-filesystem": "^2.0.38",
2323
"gatsby-transformer-react-docgen": "^4.0.1",
2424
"gatsby-transformer-sharp": "^2.1.19",

docs/src/components/Playground/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React, { useState } from 'react';
22
import ReactDOM from 'react-dom';
33
import * as bs from 'react-bootstrap';
4+
// @ts-ignore
45
import * as libs from 'wizard-ui';
56
import examples from '../../examples';
67
import AllIcon from '../Icon';

docs/yarn.lock

Lines changed: 36 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,13 @@
344344
dependencies:
345345
"@babel/helper-plugin-utils" "^7.0.0"
346346

347+
"@babel/plugin-syntax-typescript@^7.2.0":
348+
version "7.3.3"
349+
resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.3.3.tgz#a7cc3f66119a9f7ebe2de5383cce193473d65991"
350+
integrity sha512-dGwbSMA1YhVS8+31CnPR7LB4pcbrzcV99wQzby4uAfrkZPYZlQ7ImwdpzLqi6Z6IL02b8IAL379CaMwo0x5Lag==
351+
dependencies:
352+
"@babel/helper-plugin-utils" "^7.0.0"
353+
347354
"@babel/plugin-transform-arrow-functions@^7.0.0", "@babel/plugin-transform-arrow-functions@^7.2.0":
348355
version "7.2.0"
349356
resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.2.0.tgz#9aeafbe4d6ffc6563bf8f8372091628f00779550"
@@ -628,6 +635,14 @@
628635
dependencies:
629636
"@babel/helper-plugin-utils" "^7.0.0"
630637

638+
"@babel/plugin-transform-typescript@^7.3.2":
639+
version "7.4.5"
640+
resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.4.5.tgz#ab3351ba35307b79981993536c93ff8be050ba28"
641+
integrity sha512-RPB/YeGr4ZrFKNwfuQRlMf2lxoCUaU01MTw39/OFE/RiL8HDjtn68BwEPft1P7JN4akyEmjGWAMNldOV7o9V2g==
642+
dependencies:
643+
"@babel/helper-plugin-utils" "^7.0.0"
644+
"@babel/plugin-syntax-typescript" "^7.2.0"
645+
631646
"@babel/plugin-transform-unicode-regex@^7.4.4":
632647
version "7.4.4"
633648
resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.4.4.tgz#ab4634bb4f14d36728bf5978322b35587787970f"
@@ -710,6 +725,14 @@
710725
"@babel/plugin-transform-react-jsx-self" "^7.0.0"
711726
"@babel/plugin-transform-react-jsx-source" "^7.0.0"
712727

728+
"@babel/preset-typescript@^7.0.0":
729+
version "7.3.3"
730+
resolved "https://registry.yarnpkg.com/@babel/preset-typescript/-/preset-typescript-7.3.3.tgz#88669911053fa16b2b276ea2ede2ca603b3f307a"
731+
integrity sha512-mzMVuIP4lqtn4du2ynEfdO0+RYcslwrZiJHXu4MGaC1ctJiW2fyaeDrtjJGs7R/KebZ1sgowcIoWf4uRpEfKEg==
732+
dependencies:
733+
"@babel/helper-plugin-utils" "^7.0.0"
734+
"@babel/plugin-transform-typescript" "^7.3.2"
735+
713736
"@babel/runtime@^7.0.0", "@babel/runtime@^7.1.2", "@babel/runtime@^7.4.2":
714737
version "7.4.5"
715738
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.4.5.tgz#582bb531f5f9dc67d2fcb682979894f75e253f12"
@@ -2124,11 +2147,6 @@ buffer@^5.2.1:
21242147
base64-js "^1.0.2"
21252148
ieee754 "^1.1.4"
21262149

2127-
builtin-modules@^1.1.1:
2128-
version "1.1.1"
2129-
resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f"
2130-
integrity sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=
2131-
21322150
builtin-modules@^3.0.0:
21332151
version "3.1.0"
21342152
resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-3.1.0.tgz#aad97c15131eb76b65b50ef208e7584cd76a7484"
@@ -2334,7 +2352,7 @@ chalk@1.1.3, chalk@^1.0.0, chalk@^1.1.1, chalk@^1.1.3:
23342352
strip-ansi "^3.0.0"
23352353
supports-color "^2.0.0"
23362354

2337-
chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.0, chalk@^2.3.2, chalk@^2.4.1, chalk@^2.4.2:
2355+
chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.2, chalk@^2.4.1, chalk@^2.4.2:
23382356
version "2.4.2"
23392357
resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424"
23402358
integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==
@@ -2689,7 +2707,7 @@ command-exists@^1.2.2:
26892707
resolved "https://registry.yarnpkg.com/command-exists/-/command-exists-1.2.8.tgz#715acefdd1223b9c9b37110a149c6392c2852291"
26902708
integrity sha512-PM54PkseWbiiD/mMsbvW351/u+dafwTJ0ye2qB60G1aGQP9j3xK2gmMDc+R34L3nDtx4qMCitXT75mkbkGJDLw==
26912709

2692-
commander@^2.11.0, commander@^2.12.1, commander@^2.18.0, commander@^2.19.0:
2710+
commander@^2.11.0, commander@^2.18.0, commander@^2.19.0:
26932711
version "2.20.0"
26942712
resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.0.tgz#d58bb2b5c1ee8f87b0d340027e9e94e222c5a422"
26952713
integrity sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==
@@ -3602,11 +3620,6 @@ devcert-san@^0.3.3:
36023620
tmp "^0.0.31"
36033621
tslib "^1.6.0"
36043622

3605-
diff@^3.2.0:
3606-
version "3.5.0"
3607-
resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12"
3608-
integrity sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==
3609-
36103623
diff@^4.0.1:
36113624
version "4.0.1"
36123625
resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.1.tgz#0c667cb467ebbb5cea7f14f135cc2dba7780a8ff"
@@ -3923,7 +3936,7 @@ engine.io@~3.3.1:
39233936
engine.io-parser "~2.1.0"
39243937
ws "~6.1.0"
39253938

3926-
enhanced-resolve@^4.0.0, enhanced-resolve@^4.1.0:
3939+
enhanced-resolve@^4.1.0:
39273940
version "4.1.0"
39283941
resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-4.1.0.tgz#41c7e0bfdfe74ac1ffe1e57ad6a5c6c9f3742a7f"
39293942
integrity sha512-F/7vkyTtyc/llOIn8oWclcB25KdRaiPBpZYDgJHgh/UHtpgT2p2eldQgtQnLtUvfMKPKxbRaQM/hHkvLHt1Vng==
@@ -5106,15 +5119,14 @@ gatsby-plugin-sharp@^2.0.37:
51065119
sharp "^0.22.1"
51075120
svgo "^1.2.0"
51085121

5109-
gatsby-plugin-ts-loader@^0.1.0:
5110-
version "0.1.0"
5111-
resolved "https://registry.yarnpkg.com/gatsby-plugin-ts-loader/-/gatsby-plugin-ts-loader-0.1.0.tgz#248e960a2d6ee66a7d82879e36c3839811628420"
5112-
integrity sha512-tPUvov4mLPsfnuew+s5BTTGJyYxSRwKSyrfBz8hG9poKLJ5BwlRiQ3BFu53/0w/aw8u0I/ijKrkE4IN7kZ7fkg==
5122+
gatsby-plugin-typescript@^2.0.15:
5123+
version "2.0.15"
5124+
resolved "https://registry.yarnpkg.com/gatsby-plugin-typescript/-/gatsby-plugin-typescript-2.0.15.tgz#2c95e512287f8d4df02245152a94cf9601813e45"
5125+
integrity sha512-ZOKEjz+VhDLT1Q8w33JmR2NUDYiYgThab7jFZQvEd9zWA9x70BZlFL5kMy6mhHXIkD6dhPwYN1WM1yWWRzkOjw==
51135126
dependencies:
5114-
ts-loader "^5.3.2"
5115-
tslint "^5.12.0"
5116-
tslint-loader "^3.5.4"
5117-
typescript "^3.2.2"
5127+
"@babel/preset-typescript" "^7.0.0"
5128+
"@babel/runtime" "^7.0.0"
5129+
babel-plugin-remove-graphql-queries "^2.6.3"
51185130

51195131
gatsby-react-router-scroll@^2.0.7:
51205132
version "2.0.7"
@@ -10413,7 +10425,7 @@ rgba-regex@^1.0.0:
1041310425
resolved "https://registry.yarnpkg.com/rgba-regex/-/rgba-regex-1.0.0.tgz#43374e2e2ca0968b0ef1523460b7d730ff22eeb3"
1041410426
integrity sha1-QzdOLiyglosO8VI0YLfXMP8i7rM=
1041510427

10416-
rimraf@2, rimraf@2.6.3, rimraf@^2.2.8, rimraf@^2.4.4, rimraf@^2.5.0, rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.2, rimraf@^2.6.3:
10428+
rimraf@2, rimraf@2.6.3, rimraf@^2.2.8, rimraf@^2.5.0, rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.2, rimraf@^2.6.3:
1041710429
version "2.6.3"
1041810430
resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab"
1041910431
integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==
@@ -10592,7 +10604,7 @@ semver-truncate@^1.1.2:
1059210604
dependencies:
1059310605
semver "^5.3.0"
1059410606

10595-
"semver@2 || 3 || 4 || 5", semver@^5.0.1, semver@^5.0.3, semver@^5.1.0, semver@^5.3.0, semver@^5.4.1, semver@^5.5.0, semver@^5.5.1, semver@^5.6.0:
10607+
"semver@2 || 3 || 4 || 5", semver@^5.0.3, semver@^5.1.0, semver@^5.3.0, semver@^5.4.1, semver@^5.5.0, semver@^5.5.1, semver@^5.6.0:
1059610608
version "5.7.0"
1059710609
resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.0.tgz#790a7cf6fea5459bac96110b29b60412dc8ff96b"
1059810610
integrity sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==
@@ -11797,17 +11809,6 @@ trough@^1.0.0:
1179711809
dependencies:
1179811810
glob "^7.1.2"
1179911811

11800-
ts-loader@^5.3.2:
11801-
version "5.4.5"
11802-
resolved "https://registry.yarnpkg.com/ts-loader/-/ts-loader-5.4.5.tgz#a0c1f034b017a9344cef0961bfd97cc192492b8b"
11803-
integrity sha512-XYsjfnRQCBum9AMRZpk2rTYSVpdZBpZK+kDh0TeT3kxmQNBDVIeUjdPjY5RZry4eIAb8XHc4gYSUiUWPYvzSRw==
11804-
dependencies:
11805-
chalk "^2.3.0"
11806-
enhanced-resolve "^4.0.0"
11807-
loader-utils "^1.0.2"
11808-
micromatch "^3.1.4"
11809-
semver "^5.0.1"
11810-
1181111812
ts-node@^8.2.0:
1181211813
version "8.2.0"
1181311814
resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-8.2.0.tgz#4a89754b00560bb24cd54526e1685fa38c45f240"
@@ -11824,48 +11825,11 @@ ts-pnp@^1.1.2:
1182411825
resolved "https://registry.yarnpkg.com/ts-pnp/-/ts-pnp-1.1.2.tgz#be8e4bfce5d00f0f58e0666a82260c34a57af552"
1182511826
integrity sha512-f5Knjh7XCyRIzoC/z1Su1yLLRrPrFCgtUAh/9fCSP6NKbATwpOL1+idQVXQokK9GRFURn/jYPGPfegIctwunoA==
1182611827

11827-
tslib@^1.6.0, tslib@^1.8.0, tslib@^1.8.1, tslib@^1.9.0:
11828+
tslib@^1.6.0, tslib@^1.9.0:
1182811829
version "1.9.3"
1182911830
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286"
1183011831
integrity sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==
1183111832

11832-
tslint-loader@^3.5.4:
11833-
version "3.5.4"
11834-
resolved "https://registry.yarnpkg.com/tslint-loader/-/tslint-loader-3.5.4.tgz#052af7f0772434451ea1b247bb55407f878a4c40"
11835-
integrity sha512-jBHNNppXut6SgZ7CsTBh+6oMwVum9n8azbmcYSeMlsABhWWoHwjq631vIFXef3VSd75cCdX3rc6kstsB7rSVVw==
11836-
dependencies:
11837-
loader-utils "^1.0.2"
11838-
mkdirp "^0.5.1"
11839-
object-assign "^4.1.1"
11840-
rimraf "^2.4.4"
11841-
semver "^5.3.0"
11842-
11843-
tslint@^5.12.0:
11844-
version "5.17.0"
11845-
resolved "https://registry.yarnpkg.com/tslint/-/tslint-5.17.0.tgz#f9f0ce2011d8e90debaa6e9b4975f24cd16852b8"
11846-
integrity sha512-pflx87WfVoYepTet3xLfDOLDm9Jqi61UXIKePOuca0qoAZyrGWonDG9VTbji58Fy+8gciUn8Bt7y69+KEVjc/w==
11847-
dependencies:
11848-
"@babel/code-frame" "^7.0.0"
11849-
builtin-modules "^1.1.1"
11850-
chalk "^2.3.0"
11851-
commander "^2.12.1"
11852-
diff "^3.2.0"
11853-
glob "^7.1.1"
11854-
js-yaml "^3.13.1"
11855-
minimatch "^3.0.4"
11856-
mkdirp "^0.5.1"
11857-
resolve "^1.3.2"
11858-
semver "^5.3.0"
11859-
tslib "^1.8.0"
11860-
tsutils "^2.29.0"
11861-
11862-
tsutils@^2.29.0:
11863-
version "2.29.0"
11864-
resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.29.0.tgz#32b488501467acbedd4b85498673a0812aca0b99"
11865-
integrity sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA==
11866-
dependencies:
11867-
tslib "^1.8.1"
11868-
1186911833
tty-browserify@0.0.0:
1187011834
version "0.0.0"
1187111835
resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.0.tgz#a157ba402da24e9bf957f9aa69d524eed42901a6"
@@ -11913,11 +11877,6 @@ typedarray@^0.0.6:
1191311877
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
1191411878
integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=
1191511879

11916-
typescript@^3.2.2:
11917-
version "3.5.1"
11918-
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.5.1.tgz#ba72a6a600b2158139c5dd8850f700e231464202"
11919-
integrity sha512-64HkdiRv1yYZsSe4xC1WVgamNigVYjlssIoaH2HcZF0+ijsk5YK2g0G34w9wJkze8+5ow4STd22AynfO6ZYYLw==
11920-
1192111880
ua-parser-js@^0.7.18:
1192211881
version "0.7.19"
1192311882
resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.19.tgz#94151be4c0a7fb1d001af7022fdaca4642659e4b"

package.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"private": true,
55
"main": "src/index.tsx",
66
"dependencies": {
7-
"@types/jest": "24.0.13",
7+
"@types/jest": "^24.0.13",
88
"@types/node": "12.0.2",
99
"@types/react": "16.8.18",
1010
"@types/react-dom": "16.8.4",
@@ -40,11 +40,14 @@
4040
"@storybook/addon-options": "^5.0.11",
4141
"@storybook/react": "^5.0.11",
4242
"@types/classnames": "^2.2.8",
43+
"@types/enzyme": "^3.9.3",
4344
"@types/react-bootstrap": "^0.32.17",
44-
"babel-loader": "^8.0.6",
4545
"classnames": "^2.2.6",
46+
"enzyme": "^3.10.0",
47+
"enzyme-adapter-react-16": "^1.14.0",
4648
"node-sass": "^4.12.0",
4749
"raw-loader": "^2.0.0",
48-
"react-syntax-highlighter": "^7.0.4"
50+
"react-syntax-highlighter": "^7.0.4",
51+
"ts-jest": "^24.0.2"
4952
}
5053
}

src/components/Badge/index.test.tsx

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import React from 'react';
2+
import Badge from './index';
3+
import { shallow } from 'enzyme';
4+
5+
describe('Badge', () => {
6+
it('badge not showing count === 0', () => {
7+
const badge = shallow(<Badge count={0} />);
8+
expect(badge.find('.Badge').exists()).toEqual(false);
9+
});
10+
it('badge showing count === 0 with showZero', () => {
11+
const badge = shallow(<Badge count={0} showZero />);
12+
expect(badge.find('.Badge').length).toBe(1);
13+
expect(badge.text()).toEqual('0');
14+
});
15+
it('default status danger', () => {
16+
const badge = shallow(<Badge count="default" />);
17+
expect(badge.find('.Badge--danger').exists()).toEqual(true);
18+
});
19+
it('number over 99 will be set to 99+', () => {
20+
const badge = shallow(<Badge count={500} />);
21+
expect(badge.text()).toEqual('99+');
22+
});
23+
it('overflowCount can be set', () => {
24+
const badge = shallow(<Badge count={10000} overflowCount={999} />);
25+
expect(badge.text()).toEqual('999+');
26+
});
27+
it('badge showing tip with children', () => {
28+
const badge = shallow(<Badge count="2000">UI</Badge>);
29+
expect(badge.find('.Badge__wrapper').exists()).toEqual(true);
30+
});
31+
})
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './components/index';

src/index.tsx

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/react-app-env.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/// <reference types="react-scripts" />

src/setupTests.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/**
2+
* https://github.com/xsky-fe/create-react-app-wizard/blob/master/packages/react-scripts/scripts/utils/createJestConfig.js#L28
3+
* https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/template/README.md#testing-components
4+
**/
5+
import { configure } from 'enzyme';
6+
import Adapter from 'enzyme-adapter-react-16';
7+
8+
configure ({
9+
adapter: new Adapter (),
10+
})

stories/components/Badge/Default.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
2-
import { Badge } from '../../../src/lib';
3-
import BadgeCode from '!!raw-loader!../../../src/lib/Badge';
2+
import { Badge } from '../../../src/components';
3+
import BadgeCode from '!!raw-loader!../../../src/components/Badge';
44
import ComponentBody from '../../templates/ComponentBody/index';
55

66
const SIZES = ['small', 'middle', 'large'];

stories/components/Badge/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import Badge from '!!raw-loader!../../../src/lib/Badge';
1+
import Badge from '!!raw-loader!../../../src/components/Badge';
22
import Default from './Default';
33
import DefaultCode from '!!raw-loader!./Default';
44

0 commit comments

Comments
 (0)