Skip to content

Commit

Permalink
test(frontend): add tests and fix console errors (#979)
Browse files Browse the repository at this point in the history
* test(frontend): add tests and fix console errors

* refactor(frontend): minor syntax change
  • Loading branch information
UnbearableBear authored Jun 28, 2019
1 parent dfa1281 commit d445952
Show file tree
Hide file tree
Showing 56 changed files with 14,020 additions and 369 deletions.
19 changes: 19 additions & 0 deletions packages/code-du-travail-frontend/__mocks__/next/router.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module.exports = {
events: {
on() {},
off() {},
trigger() {}
},
withRouter: component => {
component.defaultProps = {
...component.defaultProps,
router: {
asPath: "mock",
route: "mock",
pathname: "mock",
query: {}
}
};
return component;
}
};
5 changes: 1 addition & 4 deletions packages/code-du-travail-frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,6 @@
"testPathIgnorePatterns": [
"<rootDir>/.next/",
"<rootDir>/node_modules/"
],
"moduleNameMapper": {
".css$": "<rootDir>/test/stubCss.js"
}
]
}
}
Loading

0 comments on commit d445952

Please sign in to comment.