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 <noreply@anthropic.com>
This commit is contained in:
@@ -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<string, unknown> }
|
||||
// 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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user