Added some small enchances

This commit is contained in:
Oleksandr Prokhorenko
2026-09-24 22:41:06 +03:00
parent 9ccbac4aca
commit 7f3a56a4ca
21 changed files with 441 additions and 211 deletions
+15 -11
View File
@@ -1,3 +1,4 @@
import { selectOption } from './helpers/select';
import { test, expect, type APIRequestContext } from '@playwright/test';
import { createDatabase } from '../packages/database/dist/index.js';
@@ -74,21 +75,24 @@ for (const language of ['en', 'ru'])
await page.goto('/app/review-queue');
const search = page.getByRole('textbox', { name: /Search merchants|Поиск мерчантов/ });
await search.fill(name);
await page
.getByRole('combobox', { name: /Account manager|Аккаунт-менеджер/ })
.selectOption('user-manager1');
await selectOption(
page.getByRole('combobox', { name: /Account manager|Аккаунт-менеджер/ }),
'user-manager1',
);
await expect(page.locator('article')).toHaveCount(1);
await expect(page.locator('article')).toContainText(/Waiting|Ожидание/);
await page
.getByRole('combobox', { name: /Waiting time|Время ожидания/ })
.selectOption('24');
await selectOption(
page.getByRole('combobox', { name: /Waiting time|Время ожидания/ }),
'24',
);
await expect(page.locator('article')).toHaveCount(0);
await expect(page).toHaveURL(/waiting=24/);
await page.reload();
await expect(search).toHaveValue(name);
await page
.getByRole('combobox', { name: /Waiting time|Время ожидания/ })
.selectOption('ALL');
await selectOption(
page.getByRole('combobox', { name: /Waiting time|Время ожидания/ }),
'ALL',
);
await expect(page.locator('article')).toHaveCount(1);
expect(await page.evaluate(() => document.documentElement.scrollWidth <= innerWidth)).toBe(
true,
@@ -110,7 +114,7 @@ for (const language of ['en', 'ru'])
'aria-invalid',
'true',
);
await dialog.getByLabel(/Decision$|^Решение$/).selectOption('REJECTED');
await selectOption(dialog.getByLabel(/Decision$|^Решение$/), 'REJECTED');
await expect(dialog.getByLabel(/Risk level|Уровень риска/)).toHaveCount(0);
await dialog.getByRole('button', { name: /^(Reject|Отклонить)$/ }).click();
const reason = dialog.getByLabel(/Rejection reason|Причина отклонения/);
@@ -166,7 +170,7 @@ test('an open decision form stays bound to its original cycle after another revi
await page.goto(`/app/merchants/${merchant.id}?tab=onboarding`);
await page.getByRole('button', { name: 'Record decision', exact: true }).click();
const dialog = page.getByRole('dialog');
await dialog.getByLabel('Risk level', { exact: true }).selectOption('LOW');
await selectOption(dialog.getByLabel('Risk level', { exact: true }), 'LOW');
await dialog
.getByLabel('Approval rationale (required)', { exact: true })
.fill('Assessment of the original submission.');