digitransit-ui/test/unit/helpers/mock-router.js
2020-09-10 14:41:38 +03:00

39 lines
670 B
JavaScript

const mockMatcher = {
routeConfig: [],
match: () => {},
getRoutes: () => {},
isActive: () => {},
format: () => {},
};
export const mockRouter = {
push: () => {},
replace: () => {},
go: () => {},
createHref: () => {},
createLocation: () => {},
addNavigationListener: () => {},
matcher: mockMatcher,
replaceRouteConfig: () => {},
isActive: () => {},
};
export const mockMatch = {
location: {
action: '',
pathname: '',
search: '',
hash: '',
index: 0,
delta: 0,
query: {},
},
routeIndices: [],
routeParams: {},
params: {},
routes: [],
router: mockRouter,
route: {
getComponent: () => {},
},
};