Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modular Refactor and Enhanced Testing for Screens #9

Merged
merged 7 commits into from
Dec 27, 2024
6 changes: 5 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,13 @@
["@components", "./src/components"],
["@constants", "./src/constants"],
["@context", "./src/context"],
["@hooks", "./src/hooks"],
["@screens", "./src/screens"],
["@redux", "./src/redux"],
["@utils", "./src/utils"],
["@validate", "./src/validate"]
["@validate", "./src/validate"],
["@testUtils", "./__tests__/utils"],
["@mocks", "./__tests__/mocks"]
],
"extensions": [".js", ".jsx", ".json"]
}
Expand Down Expand Up @@ -70,6 +73,7 @@
],
"prettier/prettier": "error",
"react/react-in-jsx-scope": "off",
"react/forbid-prop-types": "off",
// prevent eslint to complain about the "styles" variable being used before it was defined
"no-use-before-define": [
"error",
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ Click the image above to view the demo video.
- ✅ Run only necessary tests with `--findRelatedTests` flag with husky pre-commit hook.
- ✅ Use aliases for paths in imports.
- ✅ Generate automated test coverage reports and badges.
- ✅ Ensure test coverage remains at or above 80%.
- ✅ Ensure test coverage remains at or above 90%.

---

Expand Down
3 changes: 1 addition & 2 deletions __tests__/App.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@ import App from '../App';
import renderInProvider from './utils/renderInProvider';

describe('<App />', () => {
test('Text renders correctly on App', async () => {
test('App renders correctly and displays the initial text', async () => {
const { toJSON } = renderInProvider(<App />);
await waitFor(() => {
screen.getByText('Items in the basket: 0');
});
expect(toJSON()).toMatchSnapshot();
});
});
Loading
Loading