mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-08-26 20:27:13 +00:00
refactor(events): group event selection options
This commit is contained in:
@@ -353,7 +353,10 @@ test.describe('bot advanced flows', () => {
|
||||
test('keeps event routing compact and hides raw status errors', async ({
|
||||
page,
|
||||
}) => {
|
||||
await installLangBotApiMocks(page, { authenticated: true });
|
||||
await installLangBotApiMocks(page, {
|
||||
authenticated: true,
|
||||
withAdapterEvents: true,
|
||||
});
|
||||
await page.route('**/api/v1/platform/bots/*/event-routes/status', (route) =>
|
||||
route.fulfill({
|
||||
status: 500,
|
||||
@@ -416,7 +419,9 @@ test.describe('bot advanced flows', () => {
|
||||
|
||||
await expect(page).toHaveURL(/\/home\/bots\?id=bot-1$/);
|
||||
await expect(page.getByText('Supported events')).toBeVisible();
|
||||
await expect(page.getByText('1 event types')).toBeVisible();
|
||||
await expect(page.getByText('5 event types')).toBeVisible();
|
||||
await expect(page.getByText('Messages · 2')).toBeVisible();
|
||||
await expect(page.getByText('Groups · 2')).toBeVisible();
|
||||
await expect(page.getByText('Internal server error')).toHaveCount(0);
|
||||
await expect(
|
||||
page.getByText('Events that match no route are ignored.'),
|
||||
@@ -436,6 +441,14 @@ test.describe('bot advanced flows', () => {
|
||||
dangerBox!.y - (routingBox!.y + routingBox!.height),
|
||||
).toBeGreaterThanOrEqual(20);
|
||||
|
||||
await routingCard.getByRole('button', { name: 'View all' }).click();
|
||||
await expect(
|
||||
routingCard.getByText('Messages', { exact: true }),
|
||||
).toBeVisible();
|
||||
await expect(
|
||||
routingCard.getByText('Groups', { exact: true }),
|
||||
).toBeVisible();
|
||||
|
||||
await page.getByRole('button', { name: 'Refresh status' }).hover();
|
||||
await expect(
|
||||
page.getByText('Failed to refresh route status.'),
|
||||
@@ -461,6 +474,14 @@ test.describe('bot advanced flows', () => {
|
||||
await expect(
|
||||
routeDialog.getByRole('button', { name: 'Run full test' }),
|
||||
).toBeVisible();
|
||||
await routeDialog.getByRole('combobox').first().click();
|
||||
await expect(
|
||||
page.getByText('Messages', { exact: true }).last(),
|
||||
).toBeVisible();
|
||||
await expect(
|
||||
page.getByText('Groups', { exact: true }).last(),
|
||||
).toBeVisible();
|
||||
await page.keyboard.press('Escape');
|
||||
|
||||
await routeDialog.getByRole('button', { name: 'Preview match' }).click();
|
||||
await expect(routeDialog.getByText('Matched route')).toBeVisible();
|
||||
|
||||
@@ -106,6 +106,8 @@ test.describe('processor detail workbench', () => {
|
||||
await expect(
|
||||
page.getByRole('option').filter({ hasText: 'message.received' }),
|
||||
).toBeVisible();
|
||||
await expect(page.getByRole('group', { name: 'Messages' })).toHaveCount(1);
|
||||
await expect(page.getByRole('group', { name: 'Groups' })).toHaveCount(1);
|
||||
await page.keyboard.press('Escape');
|
||||
|
||||
await flow.getByRole('tab').nth(1).click();
|
||||
|
||||
Reference in New Issue
Block a user