Re-write test with storybook testing library (#150)

* Re-write test with storybook testing library

* Update CI
This commit is contained in:
Charles Bochet
2023-05-29 11:02:38 +02:00
committed by GitHub
parent 8f88605f32
commit f935a6b723
65 changed files with 8085 additions and 5164 deletions

View File

@ -30,10 +30,10 @@
"test": "react-scripts test",
"eject": "react-scripts eject",
"lint": "eslint src --max-warnings=0",
"storybook": "storybook dev -p 6006 -s public",
"storybook": "storybook dev -p 6006 -s ../public",
"test-storybook": "test-storybook",
"build-storybook": "storybook build -s public",
"coverage": "react-scripts test --coverage --watchAll",
"coverage-ci": "react-scripts test --coverage --watchAll=false",
"coverage": "test-storybook --coverage && npx nyc report --reporter=lcov -t coverage/storybook --report-dir coverage/storybook --check-coverage --lines 50",
"graphql:generate": "REACT_APP_GRAPHQL_ADMIN_SECRET=$REACT_APP_GRAPHQL_ADMIN_SECRET graphql-codegen --config codegen.js"
},
"eslintConfig": {
@ -56,24 +56,10 @@
"react-refresh": "0.14.0"
},
"jest": {
"coveragePathIgnorePatterns": [
".stories.tsx$",
"graphql.tsx$",
"apollo.tsx$",
"src/index.tsx$"
],
"testMatch": [
"<rootDir>/**/*.test.ts",
"<rootDir>/**/*.test.tsx"
],
"coverageThreshold": {
"global": {
"branches": 70,
"functions": 75,
"lines": 80,
"statements": 80
}
}
]
},
"browserslist": {
"production": [
@ -93,13 +79,16 @@
"@graphql-codegen/typescript-operations": "^3.0.4",
"@graphql-codegen/typescript-react-apollo": "^3.3.7",
"@storybook/addon-actions": "^7.0.2",
"@storybook/addon-coverage": "^0.0.8",
"@storybook/addon-essentials": "^7.0.2",
"@storybook/addon-interactions": "^7.0.2",
"@storybook/addon-links": "^7.0.2",
"@storybook/jest": "^0.1.0",
"@storybook/node-logger": "^7.0.2",
"@storybook/preset-create-react-app": "^7.0.2",
"@storybook/react": "^7.0.2",
"@storybook/react-webpack5": "^7.0.2",
"@storybook/test-runner": "^0.10.0",
"@storybook/testing-library": "^0.1.0",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
@ -109,6 +98,7 @@
"@types/uuid": "^9.0.1",
"@typescript-eslint/eslint-plugin": "^5.45.0",
"babel-plugin-named-exports-order": "^0.0.2",
"concurrently": "^8.0.1",
"eslint": "^8.28.0",
"eslint-config-prettier": "^8.5.0",
"eslint-config-react-app": "^7.0.1",
@ -119,12 +109,18 @@
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-react": "^7.31.11",
"eslint-plugin-storybook": "^0.6.11",
"http-server": "^14.1.1",
"mock-apollo-client": "^1.2.1",
"msw": "^1.2.1",
"msw-storybook-addon": "^1.8.0",
"prettier": "^2.8.0",
"prop-types": "^15.8.1",
"react-scripts": "5.0.1",
"storybook": "^7.0.2",
"typescript": "^4.9.3",
"webpack": "^5.75.0"
},
"msw": {
"workerDirectory": "public"
}
}