mirror of
https://github.com/wassname/Open-Assistant.git
synced 2026-07-26 13:07:22 +08:00
tested TaskOption component and about page
This commit is contained in:
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user