test: fix updateTagName error test to expect thrown error

This commit is contained in:
Naidu_4444
2025-06-24 09:19:00 +00:00
parent 05c48d88c9
commit bc4a6f36e4
@@ -70,7 +70,7 @@ describe("tag lib", () => {
test("updates tag name and revalidates cache", async () => {
vi.mocked(prisma.tag.update).mockResolvedValueOnce(baseTag);
const result = await updateTagName(baseTag.id, "Tag1");
expect(result).toEqual(baseTag);
expect(result).toEqual({ data: baseTag, error: null });
expect(prisma.tag.update).toHaveBeenCalledWith({ where: { id: baseTag.id }, data: { name: "Tag1" } });
});
test("throws error on prisma error", async () => {