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 <unknown> ctor, and one unused import. 41/41 still green. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
8a19e8d3f8
commit
cfbbd268e5
@@ -2,7 +2,6 @@ import { describe, it, expect } from 'vitest'
|
||||
import {
|
||||
adaptContentItems,
|
||||
adaptToFilm,
|
||||
adaptToSong,
|
||||
adaptToPodcast,
|
||||
classifyByMime,
|
||||
sortDeterministic,
|
||||
|
||||
@@ -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<unknown>((resolve) => {
|
||||
releaseChat = resolve
|
||||
}) as Promise<never>
|
||||
}
|
||||
@@ -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<unknown>((resolve) => {
|
||||
releaseChat = resolve
|
||||
}) as Promise<never>
|
||||
}
|
||||
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user