From f0500eea3d75c7f171dd3946226dd2d749a08d26 Mon Sep 17 00:00:00 2001 From: Pine Date: Fri, 14 Aug 2026 13:17:34 +0800 Subject: [PATCH] test(ui): update ui-settings-plugins assertions for the image-recognition card The apply test now expects four plugin.item cards (bash, agent-loop, web-search, image-recognition), a cardCount of 4, and two credential re-reads (web-search and image-recognition both watch the reference). Co-Authored-By: Claude --- .../client/ui-settings-plugins/tests/apply.client.spec.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/client/ui-settings-plugins/tests/apply.client.spec.ts b/packages/client/ui-settings-plugins/tests/apply.client.spec.ts index 112f088006..f407c4aa6c 100644 --- a/packages/client/ui-settings-plugins/tests/apply.client.spec.ts +++ b/packages/client/ui-settings-plugins/tests/apply.client.spec.ts @@ -73,7 +73,7 @@ describe('ui-settings-plugins apply', () => { await ctx.plugin({ inject: [...inject], apply }).await() expect(slots.entries('settings.plugin.item').map(entry => entry.options.id)) - .toEqual(['bash', 'agent-loop', 'web-search']) + .toEqual(['bash', 'agent-loop', 'web-search', 'image-recognition']) }) it('injects a live tab projection, a card count, and one business face per card', async () => { @@ -99,7 +99,7 @@ describe('ui-settings-plugins apply', () => { unsubscribe() const tab = slots.entries('settings.plugins.tab')[0]! - expect((tab.inject as unknown as () => ConfigurablePluginsTabInjected)()).toEqual({ cardCount: 3 }) + expect((tab.inject as unknown as () => ConfigurablePluginsTabInjected)()).toEqual({ cardCount: 4 }) for (const entry of slots.entries('settings.plugin.item')) { const face = (entry as { inject?: () => unknown }).inject?.() as { hooks: Record } // Each card injects exactly one snapshot store plus its own actions. @@ -118,7 +118,7 @@ describe('ui-settings-plugins apply', () => { // event is the only thing that reaches the card. ctx.remote.$dispatch('credentials/updated', ['DEEPSEEK_API_KEY']) - await vi.waitFor(() => { expect(describeCredentials).toHaveBeenCalledTimes(1) }) + await vi.waitFor(() => { expect(describeCredentials).toHaveBeenCalledTimes(2) }) }) it('ignores a credential change for a reference no card watches', async () => { @@ -148,7 +148,7 @@ describe('ui-settings-plugins apply', () => { declareRoot(slots) const fiber = ctx.plugin({ inject: [...inject], apply }) await fiber.await() - expect(slots.entries('settings.plugin.item')).toHaveLength(3) + expect(slots.entries('settings.plugin.item')).toHaveLength(4) await fiber.dispose()