From cfbbd268e5a94507878606751c7a9e6261845933 Mon Sep 17 00:00:00 2001 From: archipelago Date: Wed, 5 Aug 2026 12:05:02 -0400 Subject: [PATCH] test(13-08): satisfy vue-tsc -b build-mode checks in test files npm run build runs vue-tsc -b (project references, noUncheckedIndexedAccess), stricter than the flat --noEmit used during Task 2 verification: indexed CustomEvent accesses need non-null assertions, the suspended-chat Promise needs an explicit ctor, and one unused import. 41/41 still green. Co-Authored-By: Claude Fable 5 --- .../__tests__/archyContentAdapter.test.ts | 1 - .../src/services/__tests__/toolConfirm.test.ts | 14 +++++++------- neode-ui/src/views/__tests__/chatAiuiEmbed.test.ts | 2 +- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/neode-ui/src/composables/__tests__/archyContentAdapter.test.ts b/neode-ui/src/composables/__tests__/archyContentAdapter.test.ts index 8f4c5883..31fc3763 100644 --- a/neode-ui/src/composables/__tests__/archyContentAdapter.test.ts +++ b/neode-ui/src/composables/__tests__/archyContentAdapter.test.ts @@ -2,7 +2,6 @@ import { describe, it, expect } from 'vitest' import { adaptContentItems, adaptToFilm, - adaptToSong, adaptToPodcast, classifyByMime, sortDeterministic, diff --git a/neode-ui/src/services/__tests__/toolConfirm.test.ts b/neode-ui/src/services/__tests__/toolConfirm.test.ts index 55e79fbb..b1cc5700 100644 --- a/neode-ui/src/services/__tests__/toolConfirm.test.ts +++ b/neode-ui/src/services/__tests__/toolConfirm.test.ts @@ -75,7 +75,7 @@ describe('tool confirmation — ContextBroker half', () => { let releaseChat: (v: unknown) => void = () => {} vi.mocked(rpcClient.call).mockImplementation((opts: { method: string }) => { if (opts.method === 'assistant.chat') { - return new Promise((resolve) => { + return new Promise((resolve) => { releaseChat = resolve }) as Promise } @@ -101,8 +101,8 @@ describe('tool confirmation — ContextBroker half', () => { await vi.advanceTimersByTimeAsync(2000) expect(confirmRequests).toHaveLength(1) - expect(confirmRequests[0].detail.reqId).toBe('confirm-1') - expect(confirmRequests[0].detail.description).toBe(PENDING_IMMICH.description) + expect(confirmRequests[0]!.detail.reqId).toBe('confirm-1') + expect(confirmRequests[0]!.detail.description).toBe(PENDING_IMMICH.description) // The same pending action is never re-announced while it is open. await vi.advanceTimersByTimeAsync(3000) @@ -214,7 +214,7 @@ describe('tool confirmation — ContextBroker half', () => { let releaseChat: (v: unknown) => void = () => {} vi.mocked(rpcClient.call).mockImplementation((opts: { method: string }) => { if (opts.method === 'assistant.chat') { - return new Promise((resolve) => { + return new Promise((resolve) => { releaseChat = resolve }) as Promise } @@ -240,9 +240,9 @@ describe('tool confirmation — ContextBroker half', () => { await vi.advanceTimersByTimeAsync(2000) expect(confirmRequests).toHaveLength(2) - expect(confirmRequests[1].detail.reqId).toBe('confirm-2') - expect(confirmRequests[1].detail.description).toBe(PENDING_GITEA.description) - expect(confirmRequests[1].detail.description).not.toBe(PENDING_IMMICH.description) + expect(confirmRequests[1]!.detail.reqId).toBe('confirm-2') + expect(confirmRequests[1]!.detail.description).toBe(PENDING_GITEA.description) + expect(confirmRequests[1]!.detail.description).not.toBe(PENDING_IMMICH.description) releaseChat({ text: 'done' }) await chat diff --git a/neode-ui/src/views/__tests__/chatAiuiEmbed.test.ts b/neode-ui/src/views/__tests__/chatAiuiEmbed.test.ts index b507213f..fc1de082 100644 --- a/neode-ui/src/views/__tests__/chatAiuiEmbed.test.ts +++ b/neode-ui/src/views/__tests__/chatAiuiEmbed.test.ts @@ -112,7 +112,7 @@ describe('Chat / AIUI embed URL stability + D-14 defaults (02-07)', () => { expect(iframeSrc(wrapper)).toBe(before) // and the params are stripped so a refresh does not silently re-ask expect(routerReplaceMock).toHaveBeenCalled() - const replaceArg = routerReplaceMock.mock.calls[0][0] + const replaceArg = routerReplaceMock.mock.calls[0]![0] expect(replaceArg.query.ask).toBeUndefined() expect(replaceArg.query.askedAt).toBeUndefined() wrapper.unmount()