Added tasks, reminders, and role-specific dashboards
This commit is contained in:
+19
-5
@@ -7,9 +7,20 @@ async function signIn(page: Page, account = 'head') {
|
||||
.getByRole('button', { name: /^Sign in to workspace$|^Войти в рабочее пространство$/ })
|
||||
.click();
|
||||
await expect(page).toHaveURL(/\/app$/);
|
||||
await expect(page.getByRole('heading', { name: /^Overview$|^Обзор$/ })).toBeVisible();
|
||||
await expect(page.locator('h1')).toHaveText(
|
||||
account === 'head'
|
||||
? /Portfolio overview|Обзор портфеля/
|
||||
: account === 'compliance'
|
||||
? /Review workspace|Проверки комплаенса/
|
||||
: /My merchant workspace|Мои мерчанты/,
|
||||
);
|
||||
await expect(
|
||||
page.getByRole('heading', { name: /Pipeline at a glance|Воронка с первого взгляда/ }),
|
||||
page.getByRole('heading', {
|
||||
name:
|
||||
account === 'compliance'
|
||||
? /Oldest waiting reviews|Дольше всего ожидают/
|
||||
: /Pipeline at a glance|Воронка с первого взгляда/,
|
||||
}),
|
||||
).toBeVisible();
|
||||
}
|
||||
async function noOverflow(page: Page) {
|
||||
@@ -128,7 +139,10 @@ test('account switching removes old data, manager isolation and Compliance navig
|
||||
await page.getByRole('button', { name: 'Sign out' }).click();
|
||||
await signIn(page, 'compliance');
|
||||
expect((await (await page.request.get('/api/dashboard')).json()).merchantCount).toBe(45);
|
||||
await page.getByRole('link', { name: 'Review queue', exact: true }).click();
|
||||
await page
|
||||
.getByRole('navigation', { name: 'Workspace', exact: true })
|
||||
.getByRole('link', { name: 'Review queue', exact: true })
|
||||
.click();
|
||||
await expect(page.getByRole('heading', { name: '6 merchants awaiting review' })).toBeVisible();
|
||||
await page.getByRole('link', { name: 'Open review' }).first().click();
|
||||
await expect(page.getByRole('heading', { name: 'KYB checklist' })).toBeVisible();
|
||||
@@ -183,7 +197,7 @@ test('loading, retryable errors, empty states, session expiry and reduced motion
|
||||
await expect(page.getByRole('heading', { name: 'Rejected', exact: true })).toBeVisible();
|
||||
await page.route('**/api/tasks?**', (route) => route.fulfill({ json: [] }));
|
||||
await page.goto('/app/tasks');
|
||||
await expect(page.getByText('You’re all caught up here')).toBeVisible();
|
||||
await expect(page.getByText('No tasks in this view')).toBeVisible();
|
||||
await page.emulateMedia({ reducedMotion: 'reduce' });
|
||||
expect(
|
||||
await page
|
||||
@@ -259,7 +273,7 @@ test('Head assignment, manager editing, Compliance decisions and manager activat
|
||||
await save();
|
||||
const taskRow = page.locator('#tasks > div').filter({ hasText: 'Send the integration guide' });
|
||||
await taskRow.getByRole('button', { name: 'Complete task', exact: true }).click();
|
||||
await expect(taskRow.getByText('Completed', { exact: true }).first()).toBeVisible();
|
||||
await expect(taskRow.getByText(/^Completed ·/).first()).toBeVisible();
|
||||
await advance('Contacted');
|
||||
await advance('Qualified');
|
||||
await advance('KYB');
|
||||
|
||||
Reference in New Issue
Block a user