From 42cada78db1e58947074f12dcf7c8e41fc501b40 Mon Sep 17 00:00:00 2001 From: Adam Malczewski Date: Sun, 2 Aug 2026 13:49:14 +0900 Subject: feat(vision): add dedicated Vision settings view, move vision model setting out of Compaction --- src/app/App.test.ts | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src/app/App.test.ts') diff --git a/src/app/App.test.ts b/src/app/App.test.ts index dcdcb9b..f43a6b8 100644 --- a/src/app/App.test.ts +++ b/src/app/App.test.ts @@ -73,6 +73,11 @@ function fakeFetchImpl(): typeof fetch { status: 200, }); } + if (url.endsWith("/settings/vision")) { + return new Response(JSON.stringify({ imageLimit: 10, compactionModel: null }), { + status: 200, + }); + } return new Response(JSON.stringify({ chunks: [], latestSeq: 0 }), { status: 200 }); }; } @@ -583,4 +588,22 @@ describe("App component interaction tests", () => { store.dispose(); }); + + it("the Vision view renders the vision settings UI (image limit + compaction model)", async () => { + const ws = fakeSocket(); + const store = createAppStore({ + socketFactory: () => ws, + fetchImpl: fakeFetchImpl(), + localStorage: createFakeStorageWithViews(["vision"]), + }); + ws.resolveOpen(); + + render(App, { props: { store, onNavigate: vi.fn() } }); + + // The vision settings load (`GET /settings/vision`) seeds the inputs. + expect(await screen.findByLabelText(/Image limit/)).toBeInTheDocument(); + expect(await screen.findByLabelText(/Compaction model/)).toBeInTheDocument(); + + store.dispose(); + }); }); -- cgit v1.2.3