From 4d58bde6ff308a663a69201cc7e353286e68d2a7 Mon Sep 17 00:00:00 2001 From: Dave Date: Mon, 31 Aug 2026 01:41:26 +0200 Subject: [PATCH] fix(pos): type checkout test stub as PosPb to satisfy tsc Co-Authored-By: Claude --- src/lib/server/pos-service.test.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib/server/pos-service.test.ts b/src/lib/server/pos-service.test.ts index 8101d14..1491f84 100644 --- a/src/lib/server/pos-service.test.ts +++ b/src/lib/server/pos-service.test.ts @@ -4,6 +4,7 @@ import { listActiveStockCatalog, listSalesInRange, searchCustomersForPos, + type PosPb, } from "./pos-service"; function stubPb(items: unknown[]) { @@ -88,6 +89,8 @@ function stubCheckoutPb(opts: { let itemCounter = 0; return { + // Cast because the stub's collection() returns concrete row shapes, + // while PosPb declares getList/getOne/create generically. pb: { collection: (name: string) => ({ getFullList: vi.fn(), @@ -147,7 +150,7 @@ function stubCheckoutPb(opts: { return { id, ...data }; }), }), - }, + } as unknown as PosPb, created, updates, };