tested TaskOption component and about page

This commit is contained in:
ericv105
2023-01-10 00:45:36 -05:00
parent a0d656404e
commit d9565c5de2
3 changed files with 60 additions and 8 deletions
@@ -0,0 +1,31 @@
import { NextRouter } from "next/router";
export function createMockRouter(router: Partial<NextRouter>): NextRouter {
const mockRouter: NextRouter = {
route: "/",
pathname: "/",
query: {},
asPath: "/",
basePath: "",
defaultLocale: "en",
domainLocales: [],
isLocaleDomain: false,
push: jest.fn(),
replace: jest.fn(),
reload: jest.fn(),
back: jest.fn(),
forward: jest.fn(),
prefetch: jest.fn(),
beforePopState: jest.fn(),
isFallback: false,
isReady: true,
isPreview: false,
events: {
on: jest.fn(),
off: jest.fn(),
emit: jest.fn(),
},
...router
};
return mockRouter;
}