Implemented KYB, compliance decisions, integration, and testing
This commit is contained in:
+34
-11
@@ -130,7 +130,7 @@ test('account switching removes old data, manager isolation and Compliance navig
|
||||
expect((await (await page.request.get('/api/dashboard')).json()).merchantCount).toBe(45);
|
||||
await page.getByRole('link', { name: 'Review queue', exact: true }).click();
|
||||
await expect(page.getByRole('heading', { name: '6 merchants awaiting review' })).toBeVisible();
|
||||
await page.getByRole('link', { name: 'View checklist' }).first().click();
|
||||
await page.getByRole('link', { name: 'Open review' }).first().click();
|
||||
await expect(page.getByRole('heading', { name: 'KYB checklist' })).toBeVisible();
|
||||
await page.goto('/app/merchants/merchant-15');
|
||||
await expect(page.locator('h1')).toHaveText('Sunday Market');
|
||||
@@ -264,11 +264,11 @@ test('Head assignment, manager editing, Compliance decisions and manager activat
|
||||
await advance('Qualified');
|
||||
await advance('KYB');
|
||||
await page.getByRole('tab', { name: 'Onboarding', exact: true }).click();
|
||||
for (let i = 0; i < 4; i++) {
|
||||
await page.getByRole('button', { name: 'Update document', exact: true }).nth(i).click();
|
||||
for (let i = 0; i < 3; i++) {
|
||||
await page.getByRole('button', { name: 'Update collection', exact: true }).nth(i).click();
|
||||
await page
|
||||
.getByRole('dialog')
|
||||
.getByLabel('Document status', { exact: true })
|
||||
.getByLabel('Collection status', { exact: true })
|
||||
.selectOption('RECEIVED');
|
||||
await save();
|
||||
}
|
||||
@@ -283,26 +283,30 @@ test('Head assignment, manager editing, Compliance decisions and manager activat
|
||||
.selectOption('CORRECTIONS');
|
||||
await page
|
||||
.getByRole('dialog')
|
||||
.getByLabel('Decision reason', { exact: true })
|
||||
.getByLabel('Required changes (required)', { exact: true })
|
||||
.fill('The ownership declaration needs a current signature.');
|
||||
await page
|
||||
.getByRole('dialog')
|
||||
.getByLabel('Ownership structure', { exact: true })
|
||||
.fill('Please sign and date the declaration.');
|
||||
await save();
|
||||
await page
|
||||
.getByRole('dialog')
|
||||
.getByRole('button', { name: 'Request changes', exact: true })
|
||||
.click();
|
||||
await expect(page.getByRole('dialog')).not.toBeVisible();
|
||||
await switchAccount('alex');
|
||||
await page.getByRole('tab', { name: 'Onboarding', exact: true }).click();
|
||||
const ownership = page
|
||||
.locator('#checklist > div > div')
|
||||
.filter({ hasText: 'Ownership structure' });
|
||||
await ownership.getByRole('button', { name: 'Update document', exact: true }).click();
|
||||
await ownership.getByRole('button', { name: 'Update collection', exact: true }).click();
|
||||
await page
|
||||
.getByRole('dialog')
|
||||
.getByLabel('Document status', { exact: true })
|
||||
.getByLabel('Collection status', { exact: true })
|
||||
.selectOption('RECEIVED');
|
||||
await page
|
||||
.getByRole('dialog')
|
||||
.getByLabel('Note', { exact: true })
|
||||
.getByLabel('Collection notes', { exact: true })
|
||||
.fill('Updated signature received.');
|
||||
await save();
|
||||
await advance('Compliance Review');
|
||||
@@ -311,9 +315,11 @@ test('Head assignment, manager editing, Compliance decisions and manager activat
|
||||
await page.getByRole('button', { name: 'Record decision', exact: true }).click();
|
||||
await page
|
||||
.getByRole('dialog')
|
||||
.getByLabel('Decision reason', { exact: true })
|
||||
.getByLabel('Approval rationale (required)', { exact: true })
|
||||
.fill('All evidence checked and approved.');
|
||||
await save();
|
||||
await page.getByRole('dialog').getByLabel('Risk level', { exact: true }).selectOption('LOW');
|
||||
await page.getByRole('dialog').getByRole('button', { name: 'Approve', exact: true }).click();
|
||||
await expect(page.getByRole('dialog')).not.toBeVisible();
|
||||
await expect(page.getByRole('button', { name: 'Edit merchant', exact: true })).toHaveCount(0);
|
||||
await switchAccount('alex');
|
||||
await page.getByRole('button', { name: 'Edit merchant', exact: true }).click();
|
||||
@@ -321,7 +327,24 @@ test('Head assignment, manager editing, Compliance decisions and manager activat
|
||||
page.getByRole('dialog').getByLabel('Legal company name', { exact: true }),
|
||||
).toBeDisabled();
|
||||
await page.getByRole('button', { name: 'Cancel', exact: true }).click();
|
||||
await page.getByRole('tab', { name: 'Onboarding', exact: true }).click();
|
||||
const check = async (name: string, result: string) => {
|
||||
const row = page
|
||||
.locator('article')
|
||||
.filter({ has: page.getByRole('heading', { name, exact: true }) });
|
||||
await row.getByRole('button', { name: 'Update demo check' }).click();
|
||||
await page.getByRole('dialog').getByLabel('Result', { exact: true }).selectOption(result);
|
||||
await save();
|
||||
};
|
||||
await expect(page.getByRole('button', { name: 'Move to Testing', exact: true })).toBeDisabled();
|
||||
await check('API connection', 'COMPLETE');
|
||||
await check('Webhook setup', 'COMPLETE');
|
||||
await advance('Testing');
|
||||
await expect(page.getByRole('button', { name: 'Move to Live', exact: true })).toBeDisabled();
|
||||
await check('Test payment', 'FAILED');
|
||||
await check('Reconciliation', 'PASSED');
|
||||
await expect(page.getByRole('button', { name: 'Move to Live', exact: true })).toBeDisabled();
|
||||
await check('Test payment', 'PASSED');
|
||||
await advance('Live');
|
||||
await noOverflow(page);
|
||||
await page.screenshot({ path: info.outputPath('approved-live-merchant.png'), fullPage: true });
|
||||
|
||||
Reference in New Issue
Block a user