From 4a8925f09e4cc4ca6b049c5392f16ea0faa8ac30 Mon Sep 17 00:00:00 2001 From: archipelago Date: Fri, 31 Jul 2026 22:29:28 -0400 Subject: [PATCH] fix(01-14): satisfy vue-tsc strict-null checks in usePaidItemViewer.test.ts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit npm run build's vue-tsc -b pass caught TS2532 (possibly-undefined array access) on two array-index reads the vitest run alone doesn't type-check — optional-chain them. Co-Authored-By: Claude Opus 5 (1M context) --- neode-ui/src/composables/__tests__/usePaidItemViewer.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/neode-ui/src/composables/__tests__/usePaidItemViewer.test.ts b/neode-ui/src/composables/__tests__/usePaidItemViewer.test.ts index 0b2f80b9..1868ad46 100644 --- a/neode-ui/src/composables/__tests__/usePaidItemViewer.test.ts +++ b/neode-ui/src/composables/__tests__/usePaidItemViewer.test.ts @@ -95,7 +95,7 @@ describe('usePaidItemViewer — UIFIX-04 (lightbox routing) + UIFIX-06 (loading/ expect(windowOpenSpy).not.toHaveBeenCalled() expect(viewer.lightboxIndex.value).toBe(0) - expect(viewer.lightboxItems.value[0].name).toBe('holiday.mp4') + expect(viewer.lightboxItems.value[0]?.name).toBe('holiday.mp4') }) it('routes an audio mime to the audio player, never the lightbox', async () => { @@ -128,7 +128,7 @@ describe('usePaidItemViewer — UIFIX-04 (lightbox routing) + UIFIX-06 (loading/ await viewer.open(IMAGE_ITEM) - expect(viewer.lightboxItems.value[0].name.endsWith('.jpg')).toBe(true) + expect(viewer.lightboxItems.value[0]?.name.endsWith('.jpg')).toBe(true) }) it('sets opening for the whole duration of the fetch and clears it on success', async () => {