fix: not related app agent not show panel

This commit is contained in:
Joel
2026-06-22 18:29:58 +08:00
parent 9573e1c842
commit c8d2a0febf

View File

@ -478,4 +478,23 @@ describe('AgentConfigurePublishBar', () => {
agent_id: 'agent-1',
}))
})
it('should publish directly from the publish shortcut when no workflows reference the agent', async () => {
const { onPublish } = renderPublishBar({
activeConfigSnapshot,
prompt: 'Updated system prompt',
})
const publishShortcut = hotkeyRegistrations.get('Mod+Shift+P')
await act(async () => {
await publishShortcut?.callback({ preventDefault: vi.fn() })
})
expect(screen.queryByRole('region', {
name: /agentV2\.agentDetail\.configure\.publishImpact\.title/,
})).not.toBeInTheDocument()
expect(onPublish).toHaveBeenCalledWith(expect.objectContaining({
agent_id: 'agent-1',
}))
})
})