Skip to content

Commit

Permalink
fix: unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MexicanAce committed Nov 22, 2024
1 parent e5404bb commit 9e92a60
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/app/tests/views/AddressView.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ vi.mock("vue-router", () => ({
page: vi.fn(),
},
}),
createWebHistory: () => vi.fn(),
createRouter: () => vi.fn(),
}));

vi.mock("ohmyfetch", () => {
Expand Down
2 changes: 2 additions & 0 deletions packages/app/tests/views/BatchView.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ vi.mock("@/composables/useSearch", () => {
vi.mock("vue-router", () => ({
useRouter: () => router,
useRoute: () => vi.fn(),
createWebHistory: () => vi.fn(),
createRouter: () => vi.fn(),
}));

vi.mock("ohmyfetch", () => {
Expand Down
2 changes: 2 additions & 0 deletions packages/app/tests/views/BatchesView.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ vi.mock("vue-router", () => ({
useRoute: () => ({
query: routeQueryMock(),
}),
createWebHistory: () => vi.fn(),
createRouter: () => vi.fn(),
}));

import enUS from "@/locales/en.json";
Expand Down
2 changes: 2 additions & 0 deletions packages/app/tests/views/BlockView.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ vi.mock("@/composables/useSearch", () => {
vi.mock("vue-router", () => ({
useRouter: () => router,
useRoute: () => vi.fn(),
createWebHistory: () => vi.fn(),
createRouter: () => vi.fn(),
}));

vi.mock("ohmyfetch", () => {
Expand Down
2 changes: 2 additions & 0 deletions packages/app/tests/views/BlocksView.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ vi.mock("vue-router", () => ({
useRoute: () => ({
query: routeQueryMock(),
}),
createWebHistory: () => vi.fn(),
createRouter: () => vi.fn(),
}));

import enUS from "@/locales/en.json";
Expand Down
2 changes: 2 additions & 0 deletions packages/app/tests/views/ContractVerificationView.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ vi.mock("vue-router", () => ({
address: "0x5c221e77624690fff6dd741493d735a17716c26b",
},
}),
createWebHistory: () => vi.fn(),
createRouter: () => vi.fn(),
}));

vi.mock("ohmyfetch", () => {
Expand Down
3 changes: 3 additions & 0 deletions packages/app/tests/views/DebuggerView.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,10 @@ describe("DebuggerView:", () => {
vi.mock("vue-router", () => ({
useRouter: () => vi.fn(),
useRoute: () => vi.fn(),
createWebHistory: () => vi.fn(),
createRouter: () => vi.fn(),
}));

it("has correct title", async () => {
expect(i18n.global.t(routes.find((e) => e.name === "debugger")?.meta?.title as string)).toBe("zkEVM Debugger");
});
Expand Down
2 changes: 2 additions & 0 deletions packages/app/tests/views/HomeView.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ vi.mock("ohmyfetch", () => {
vi.mock("vue-router", () => ({
useRouter: () => vi.fn(),
useRoute: () => vi.fn(),
createWebHistory: () => vi.fn(),
createRouter: () => vi.fn(),
}));

vi.mock("@/composables/useToken", () => {
Expand Down
2 changes: 2 additions & 0 deletions packages/app/tests/views/TransactionView.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ vi.mock("vue-router", () => ({
useRoute: () => ({
query: {},
}),
createWebHistory: () => vi.fn(),
createRouter: () => vi.fn(),
}));

vi.mock("ohmyfetch", () => {
Expand Down
2 changes: 2 additions & 0 deletions packages/app/tests/views/TransactionsView.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ vi.mock("vue-router", () => ({
useRoute: () => ({
query: routeQueryMock(),
}),
createWebHistory: () => vi.fn(),
createRouter: () => vi.fn(),
}));

import $testId from "@/plugins/testId";
Expand Down

0 comments on commit 9e92a60

Please sign in to comment.