Make api mock preserve other Convex routes in rename test

This commit is contained in:
Esdras Renan 2025-11-27 08:31:53 -03:00
parent 35de633b6f
commit cb0ee989c0

View file

@ -13,9 +13,16 @@ vi.mock("convex/browser", () => ({
ConvexHttpClient: vi.fn(() => ({ mutation: mutationMock })),
}))
vi.mock("@/convex/_generated/api", () => ({
api: { users: { ensureUser: "users:ensureUser" } },
}))
vi.mock("@/convex/_generated/api", async () => {
const actual = await vi.importActual<typeof import("@/convex/_generated/api")>("@/convex/_generated/api")
return {
...actual,
api: {
...actual.api,
users: { ensureUser: "users:ensureUser" },
},
}
})
describe("POST /api/admin/devices/rename", () => {
beforeEach(() => {