Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion central-ui/tests/docs-screenshots.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ const storefrontClient = {
};

const alphaAdmin = { id: 'alpha_admin', description: { en: 'Alpha admin' }, permissions: ['orders.read', 'orders.write'], active: true };
const userRole = { id: 'user', description: { en: 'Self-registered user' }, permissions: [], active: true };

const dana = {
id: '00000000-0000-0000-0000-000000000042',
Expand All @@ -65,7 +66,7 @@ const state = {
permissions: { [tenant]: permissions },
resources: { [tenant]: [ordersApi] },
clients: { [tenant]: [storefrontClient] },
roles: { [tenant]: [alphaAdmin] },
roles: { [tenant]: [alphaAdmin, userRole] },
users: [dana],
};

Expand Down Expand Up @@ -128,6 +129,24 @@ test('client create form', async ({ page }) => {
await shot(page, 'client-created-secret');
});

test('client registration flow form', async ({ page }) => {
await loadAdminApp(page, { path: `/?view=clients&tenant=${tenant}`, state });

await page.getByRole('button', { name: '+ Create Client', exact: true }).click();
await page.getByLabel('Client ID').fill('checkout-web');
await page.getByLabel('Client Name').fill('Checkout Web');
await page.getByPlaceholder('https://app.example.com/callback').fill('https://checkout.example.com/callback');
await page.getByPlaceholder('https://app.example.com/callback').press('Enter');

const registrationRow = page.getByText('Registration', { exact: true }).locator('..');
await registrationRow.locator('label.toggle').click();
await expect(page.locator('[aria-label="Registration credential (locked)"]')).toContainText('phone');

await page.getByLabel('Challenge', { exact: true }).selectOption('setPassword');
await page.getByRole('group', { name: 'Assigned roles' }).getByRole('checkbox', { name: 'alpha_admin', exact: true }).check();
await shot(page, 'client-form-registration', true);
});

test('resources list', async ({ page }) => {
await loadAdminApp(page, { path: `/?view=resources&tenant=${tenant}`, state });

Expand Down
Loading