diff --git a/tests/e2e/scenarios/full-chain.steps.ts b/tests/e2e/scenarios/full-chain.steps.ts index 1afd15c..92e657d 100644 --- a/tests/e2e/scenarios/full-chain.steps.ts +++ b/tests/e2e/scenarios/full-chain.steps.ts @@ -130,9 +130,10 @@ async function maybeFailShot(ctx: Ctx, step: Step) { ;(step.screenshots ??= []).push({ rel: sh.rel, caption: `Состояние на падении ${step.id}` }) } -// helper: inventory stock for product (store-scoped) +// helper: inventory stock for product (store-scoped). Фильтруем по складу: без +// storeId список отдаёт агрегат «Все склады» (storeId = Guid.Empty), а не строку склада. async function stockOf(api: AxiosInstance, storeId: string, productId: string): Promise { - const r = await api.get(`/api/inventory/stock?productId=${productId}&pageSize=200`) + const r = await api.get(`/api/inventory/stock?productId=${productId}&storeId=${storeId}&includeZero=true&pageSize=200`) if (r.status !== 200) return 0 const items = (r.data?.items ?? []) as { storeId?: string; quantity: number; productId: string }[] const row = items.find((i) => i.storeId === storeId && i.productId === productId)