Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
khanghy2130 committed Oct 16, 2024
1 parent a08469c commit c545fc6
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
20 changes: 20 additions & 0 deletions app/tests/product/ProductDetails.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,26 @@ const mockUseOutletContext = {
error: null,
}),
),
range: vi.fn(() => ({
order: vi.fn(() => ({
abortSignal: vi.fn(() => ({
returns: vi.fn(() =>
Promise.resolve({
data: [{ id: 1, name: "item1" }],
error: null,
}),
),
})),
})),
abortSignal: vi.fn(() => ({
returns: vi.fn(() =>
Promise.resolve({
data: [],
error: null,
}),
),
})),
})),
})),
})),
}),
Expand Down
1 change: 1 addition & 0 deletions app/tests/profile/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ describe("Profile page", () => {
},
setUserDisplayName: vi.fn(),
setWishlist: vi.fn(),
setAvatarUri: vi.fn(),
});
(useLoaderData as Mock).mockReturnValue({
newWishlist: [1, 2],
Expand Down

0 comments on commit c545fc6

Please sign in to comment.