From 76796df39b2bd6a461c31c8f0afbadab0b953940 Mon Sep 17 00:00:00 2001 From: imccyu <276526105+imccyu@users.noreply.github.com> Date: Tue, 28 Jul 2026 21:49:53 +0800 Subject: [PATCH] test: close the two coverage tails on the plan surfaces The plan unit's same-reference gate for a repeated identical /plan selection (the one uncovered branch in plan-mode/index.ts) gains an explicit case, and ui-plan's empty node-half apply is exercised the way sibling surface plugins do (the ui-conversation no-op precedent). Both files read 100% across all four axes under the CI coverage lane's per-file thresholds. --- packages/client/ui-plan/tests/browser-plugin.spec.ts | 5 +++++ packages/plan/plan-mode/tests/projection.spec.ts | 3 +++ 2 files changed, 8 insertions(+) diff --git a/packages/client/ui-plan/tests/browser-plugin.spec.ts b/packages/client/ui-plan/tests/browser-plugin.spec.ts index c16321aa87..1a6b85a586 100644 --- a/packages/client/ui-plan/tests/browser-plugin.spec.ts +++ b/packages/client/ui-plan/tests/browser-plugin.spec.ts @@ -12,6 +12,7 @@ import type { SessionId } from '@deepseek-ai/dsh-client-runtime/client' import { PlanModeControl } from '../src/client/PlanModeControl.tsx' import type { PlanModeControlInjected } from '../src/client/index.ts' import { apply, inject } from '../src/client/index.ts' +import { apply as nodeApply } from '../src/index.ts' const SID = 's-plan' as SessionId @@ -35,6 +36,10 @@ describe('ui-plan browser apply', () => { expect(inject).toEqual(['slots', 'connection', 'conversation']) }) + it('node-half apply is an intentional no-op', () => { + expect(() => { nodeApply() }).not.toThrow() + }) + it('fails loud when conversation did not declare the plan seat', async () => { const ctx = new Context() await ctx.plugin(SlotsService).await() diff --git a/packages/plan/plan-mode/tests/projection.spec.ts b/packages/plan/plan-mode/tests/projection.spec.ts index c681d44aaf..dbd6d5a733 100644 --- a/packages/plan/plan-mode/tests/projection.spec.ts +++ b/packages/plan/plan-mode/tests/projection.spec.ts @@ -73,6 +73,9 @@ describe('plan projection unit', () => { const bench = await harness(true) runPlanCommand(bench.session, '', 0) expect(bench.values().plan).toEqual({ active: false, pending: true }) + // A repeated identical selection returns the same state reference (no frame). + runPlanCommand(bench.session, '', 1) + expect(bench.values().plan).toEqual({ active: false, pending: true }) commitPlanMode(bench.session, true, 0) expect(bench.values().plan).toEqual({ active: true, pending: false }) })