feat: complete Epic 1 production foundation

This commit is contained in:
2026-08-25 01:24:11 +03:00
parent 767428436d
commit 182bde8ac0
298 changed files with 35719 additions and 5299 deletions
+42 -1
View File
@@ -11,6 +11,9 @@ test('agents page shows demo cards and edit drawer opens', async ({ page }) => {
await expect(page.locator('.agent-card-date').first()).toContainText(
localized('Set this endpoint', 'Данный эндпоинт')
);
await expect(page.locator('.agent-card-date').filter({
hasText: localized('Catalog rev', 'Ревизия каталога'),
}).first()).toBeVisible();
await page.getByRole('button', { name: localized('New agent', 'Новый агент') }).click();
await expect(page.locator('.drawer-title')).toHaveText(localized('New agent', 'Новый агент'));
await expect(page.locator('.drawer-subtitle')).toContainText(
@@ -40,7 +43,45 @@ test('agent drawer configures on-demand tool discovery and catalog sections', as
await expect(group.locator('input').nth(1)).toHaveValue('finance');
await expect(page.locator('.tool-search-preview')).toBeVisible();
await page.locator('.tool-group-chip').first().click();
await page.locator('.tool-search-preview input').fill('currency rate');
await page.locator('.tool-search-preview input').fill('frankfurter_latest_rate');
await page.locator('.tool-search-preview .btn-primary-sm').click();
await expect(page.locator('.tool-search-result').first()).toBeVisible();
});
test('agent lifecycle stale conflict shows localized recovery message', async ({ page }) => {
await login(page);
await page.goto('/agents');
await expect(page.locator('.agent-card').first()).toBeVisible();
await page.route(/\/api\/admin\/workspaces\/[^/]+\/agents\/[^/]+\/unpublish$/, async (route) => {
await route.fulfill({
status: 409,
contentType: 'application/json',
headers: {
'x-request-id': '01a00000-0000-7000-8000-000000000001',
'x-trace-id': '01a00000000070008000000000000001',
},
body: JSON.stringify({
error: {
code: 'conflict',
message: 'agent changed',
context: {
error_code: 'agent_stale_revision',
},
},
}),
});
});
page.once('dialog', async (dialog) => {
expect(dialog.message()).toMatch(localized('Unpublish', 'Снять'));
await dialog.accept();
});
await page.getByRole('button', { name: localized('Unpublish', 'Снять с публикации') }).first().click();
await expect(page.locator('.toast-error')).toContainText(
localized(
'Agent changed in another request. Reload the drawer and retry.',
'Агент изменился в другом запросе. Перезагрузите форму и повторите действие.',
),
);
});