setup.js 533 B

123456789101112131415161718192021222324252627
  1. jest.mock('app/translations');
  2. import jQuery from 'jquery';
  3. window.$ = window.jQuery = jQuery;
  4. import sinon from 'sinon';
  5. window.sinon = sinon;
  6. window.TestStubs = {
  7. // react-router's 'router' context
  8. router: () => ({
  9. push: sinon.spy(),
  10. replace: sinon.spy(),
  11. go: sinon.spy(),
  12. goBack: sinon.spy(),
  13. goForward: sinon.spy(),
  14. setRouteLeaveHook: sinon.spy(),
  15. isActive: sinon.spy()
  16. }),
  17. Team: (...params) => {
  18. return {
  19. slug: 'team-slug',
  20. name: 'Team Name',
  21. ...params
  22. };
  23. }
  24. };