mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-08-26 20:27:13 +00:00
feat(web): streamline management and knowledge settings
This commit is contained in:
@@ -244,18 +244,25 @@ test.describe('frontend CRUD smoke flows', () => {
|
||||
|
||||
await expect(page).toHaveURL(/\/home\/knowledge\?id=knowledge-1$/);
|
||||
await page.reload();
|
||||
await expect(page.locator('input[name="name"]')).toHaveValue(
|
||||
'Support Knowledge',
|
||||
);
|
||||
await page.waitForTimeout(600);
|
||||
await expect(
|
||||
page.getByRole('heading', { name: /Support Knowledge/ }),
|
||||
).toBeVisible();
|
||||
await expect(page.locator('input[name="name"]')).toHaveCount(0);
|
||||
const engineSettings = page.locator('[data-slot="card"]').filter({
|
||||
has: page.getByText('Engine Settings', { exact: true }),
|
||||
});
|
||||
await expect(engineSettings.getByRole('combobox')).toBeVisible();
|
||||
|
||||
await page
|
||||
.locator('input[name="description"]')
|
||||
await page.getByRole('button', { name: 'Edit basic information' }).click();
|
||||
const kbInfoDialog = page.getByRole('dialog');
|
||||
await kbInfoDialog.getByLabel('Name').fill('Support Knowledge Updated');
|
||||
await kbInfoDialog
|
||||
.getByLabel('Description')
|
||||
.fill('Updated source material for support answers.');
|
||||
await save(page);
|
||||
await expect(page.locator('input[name="description"]')).toHaveValue(
|
||||
'Updated source material for support answers.',
|
||||
);
|
||||
await kbInfoDialog.getByRole('button', { name: 'Save' }).click();
|
||||
await expect(
|
||||
page.getByRole('heading', { name: /Support Knowledge Updated/ }),
|
||||
).toBeVisible();
|
||||
|
||||
await page.getByRole('button', { name: /^Delete$/ }).click();
|
||||
await confirmDelete(page);
|
||||
|
||||
@@ -45,12 +45,16 @@ test.describe('processor detail workbench', () => {
|
||||
expect(debugBox!.y).toBeGreaterThanOrEqual(0);
|
||||
|
||||
const flow = configPanel.getByRole('tablist');
|
||||
await expect(flow.getByRole('tab').nth(0)).toContainText('Management');
|
||||
await expect(flow.getByRole('tab').nth(1)).toContainText(
|
||||
await expect(flow.getByRole('tab').nth(0)).toContainText(
|
||||
'Bindable Event Range',
|
||||
);
|
||||
await expect(flow.getByRole('tab').nth(2)).toContainText('Runner');
|
||||
await expect(flow.getByRole('tab').nth(3)).toContainText('Local Agent');
|
||||
await expect(flow.getByRole('tab').nth(1)).toContainText('Runner');
|
||||
await expect(flow.getByRole('tab').nth(2)).toContainText('Local Agent');
|
||||
const agentManagement = configPanel.getByRole('button', {
|
||||
name: 'Management',
|
||||
});
|
||||
await expect(agentManagement).toBeVisible();
|
||||
await expect(flow.getByText('Management')).toHaveCount(0);
|
||||
|
||||
await expect(
|
||||
page.getByRole('heading', { name: /agent-workbench/ }),
|
||||
@@ -73,11 +77,11 @@ test.describe('processor detail workbench', () => {
|
||||
.last(),
|
||||
).toBeVisible();
|
||||
|
||||
await flow.getByRole('tab').nth(1).click();
|
||||
await flow.getByRole('tab').nth(0).click();
|
||||
await expect(
|
||||
configPanel.getByText('Bindable Event Range', { exact: true }).last(),
|
||||
).toBeVisible();
|
||||
await flow.getByRole('tab').nth(3).click();
|
||||
await flow.getByRole('tab').nth(2).click();
|
||||
await expect(
|
||||
configPanel.getByText('Local Agent', { exact: true }).last(),
|
||||
).toBeVisible();
|
||||
@@ -217,6 +221,9 @@ test.describe('processor detail workbench', () => {
|
||||
page.getByRole('heading', { name: /Renamed Pipeline/ }),
|
||||
).toBeVisible();
|
||||
|
||||
const secondaryNavigation = configPanel.locator('nav').getByRole('button');
|
||||
await expect(secondaryNavigation.last()).toHaveText('Management');
|
||||
|
||||
const debugBox = await debugPanel.boundingBox();
|
||||
const configBox = await configPanel.boundingBox();
|
||||
expect(debugBox).not.toBeNull();
|
||||
|
||||
Reference in New Issue
Block a user