From 5a2ab4589c32c466a6c7c8a107d1fb79cfaea667 Mon Sep 17 00:00:00 2001 From: nns Date: Fri, 9 Oct 2026 10:23:49 +0500 Subject: [PATCH] =?UTF-8?q?test(e2e):=20full-chain=20stockOf=20=D1=87?= =?UTF-8?q?=D0=B8=D1=82=D0=B0=D0=B5=D1=82=20=D0=BE=D1=81=D1=82=D0=B0=D1=82?= =?UTF-8?q?=D0=BE=D0=BA=20=D0=BF=D0=BE=20=D1=81=D0=BA=D0=BB=D0=B0=D0=B4?= =?UTF-8?q?=D1=83=20(=D0=BD=D0=B5=20=D0=B0=D0=B3=D1=80=D0=B5=D0=B3=D0=B0?= =?UTF-8?q?=D1=82)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit После перехода остатков на агрегат «Все склады» при отсутствии storeId, stockOf без storeId получал агрегатную строку (storeId=Guid.Empty) и не находил склад → остатки читались как 0, что роняло приёмки/склад/инварианты. Теперь запрос с storeId (+includeZero). full-chain снова 16/16 зелёный. Co-Authored-By: Claude Opus 4.8 --- tests/e2e/scenarios/full-chain.steps.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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)