diff --git a/core/http/react-ui/e2e/agents.spec.js b/core/http/react-ui/e2e/agents.spec.js index ebfebd153..1935413bf 100644 --- a/core/http/react-ui/e2e/agents.spec.js +++ b/core/http/react-ui/e2e/agents.spec.js @@ -13,6 +13,18 @@ test.describe('Agents page', () => { await expect(page.getByRole('button', { name: 'Create Agent' }).first()).toBeVisible() }) + test('keeps Import Agent visible when agents exist', async ({ page }) => { + await page.route('**/api/agents', route => route.fulfill({ + json: { agents: ['existing-agent'], statuses: { 'existing-agent': true } }, + })) + await page.route('**/api/agents/existing-agent/observables', route => route.fulfill({ + json: { History: [] }, + })) + await page.reload() + + await expect(page.locator('.header-actions label', { hasText: 'Import' })).toBeVisible() + }) + test('Create Agent navigates to the agent creation form', async ({ page }) => { const create = page.getByRole('button', { name: 'Create Agent' }).last() await create.scrollIntoViewIfNeeded() diff --git a/core/http/react-ui/src/pages/Agents.jsx b/core/http/react-ui/src/pages/Agents.jsx index 7e8e2c776..c45539dea 100644 --- a/core/http/react-ui/src/pages/Agents.jsx +++ b/core/http/react-ui/src/pages/Agents.jsx @@ -194,9 +194,9 @@ export default function Agents() { )} {/* A label styled as a button, wrapping the file input it triggers, so the control looks and behaves like its neighbours. */} -