From b26c1d258101b474fa05a7487bdd8ac52835e64b Mon Sep 17 00:00:00 2001 From: Andrey Epifancev Date: Wed, 28 Oct 2026 22:15:41 +0400 Subject: [PATCH] =?UTF-8?q?fix(web):=20=D0=BA=D0=BB=D1=8E=D1=87=20=D0=BD?= =?UTF-8?q?=D0=B5=D1=80=D0=B0=D1=81=D0=BF=D1=80=D0=B5=D0=B4=D0=B5=D0=BB?= =?UTF-8?q?=D1=91=D0=BD=D0=BD=D0=BE=D0=B9=20=D1=81=D1=82=D1=80=D0=BE=D0=BA?= =?UTF-8?q?=D0=B8=20=D0=B2=D0=BA=D0=BB=D1=8E=D1=87=D0=B0=D0=B5=D1=82=20?= =?UTF-8?q?=D1=81=D1=82=D0=BE=D1=80=D0=BE=D0=BD=D1=83=20(#206)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I-3: u||; тест на две позиции с одинаковыми entry_ids. Co-Authored-By: Claude Opus 5.5 --- web/src/widgets/CorrectionTable/tableModel.test.ts | 13 +++++++++++++ web/src/widgets/CorrectionTable/tableModel.ts | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/web/src/widgets/CorrectionTable/tableModel.test.ts b/web/src/widgets/CorrectionTable/tableModel.test.ts index bf76e37..1f019d2 100644 --- a/web/src/widgets/CorrectionTable/tableModel.test.ts +++ b/web/src/widgets/CorrectionTable/tableModel.test.ts @@ -113,6 +113,19 @@ describe('buildRows и итоги', () => { expect(rows.filter((r) => r.kind === 'entry')).toHaveLength(8); expect(rows.filter((r) => r.kind === 'unallocated')).toHaveLength(t.unallocated.length); }); + it('две позиции нераспределённой строки (Д и К) с одинаковыми entry_ids — разные ключи', () => { + const t = table(); + const base = t.unallocated[0]; + t.unallocated = [ + { ...base, side: 'D', entry_ids: ['e1'] }, + { ...base, side: 'K', entry_ids: ['e1'] }, + ]; + const keys = buildRows(filterTable(t, { ...EMPTY_FILTERS, recordType: 'unallocated' }), new Set()) + .filter((r) => r.kind === 'unallocated') + .map((r) => r.key); + expect(keys).toHaveLength(2); + expect(new Set(keys).size).toBe(2); + }); it('visibleTotals по ЭПТ — ИЛС и правилу 3', () => { const t = table(); const picked = t.aggregates.filter((a) => a.company_1.name === 'ЭПТ' || a.rule_id === 'r3'); diff --git a/web/src/widgets/CorrectionTable/tableModel.ts b/web/src/widgets/CorrectionTable/tableModel.ts index 92b5739..a861b66 100644 --- a/web/src/widgets/CorrectionTable/tableModel.ts +++ b/web/src/widgets/CorrectionTable/tableModel.ts @@ -130,7 +130,7 @@ export function buildRows(view: ReturnType, expanded: Readon rows.push({ kind: 'entry', key: `${key}|${side}|${entry.entry_ids.join(',')}`, parentKey: key, side, entry }); } } - for (const entry of view.unallocated) rows.push({ kind: 'unallocated', key: `u|${entry.entry_ids.join(',')}`, entry }); + for (const entry of view.unallocated) rows.push({ kind: 'unallocated', key: `u|${entry.side}|${entry.entry_ids.join(',')}`, entry }); return rows; }