Skip to content
Draft
Show file tree
Hide file tree
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
14 changes: 8 additions & 6 deletions docs/test-architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,15 +208,17 @@ run does not prove for each one; the taxonomy and cross-repository entries live
and Ident (`SumsubAuto`) to `Completed`. A green run does **not** prove those steps complete
through the product path, including live ident.
- **The settings verification-call visual spec answers GET /v2/user itself.**
`e2e/settings-verification-call.spec.ts` fulfils `/v2/user` with three synthetic kyc payloads
(`phoneCallAccepted` unset / true / false) and fulfils the Settings bootstrap GETs
`e2e/settings-verification-call.spec.ts` fulfils `/v2/user` with five synthetic kyc payloads
(`phoneCallAccepted` unset / true / false and `phoneCallStatus` Completed / Failed) and fulfils
the Settings bootstrap GETs
(`/v1/language`, `/v1/fiat`, `/v1/asset`, `/v1/bankAccount`, `/v1/country`,
`/v1/setting/infoBanner`) plus user PUT/PATCH. Unmatched `/v1/**` and `/v2/**` calls
get `501`. The session is a synthetic unsigned JWT, so a green run does not prove
login or token verification. A green run proves those three consent states render.
It does not prove that a live account has those kyc fields, that those bootstrap
endpoints return real data, that `updateCallSettings` persists, or that
Completed/Failed hide the section.
login or token verification. A green run proves those five states render the consent
UI or the applicable status notice and button. It does not prove that a live account
has those kyc fields or ever reaches either `phoneCallStatus`, that those bootstrap
endpoints return real data, that `updateCallSettings` persists, or that the target
screen of the `Request a new call` button exists.
- **The info-banner layout visual spec answers GET /v1/setting/infoBanner itself.**
`e2e/info-banner-layout.spec.ts` fulfils `/v1/setting/infoBanner` with synthetic
multilingual copy, fulfils `GET /v1/support/issue` with one fixture ticket, and
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 39 additions & 1 deletion e2e/settings-verification-call.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { test, expect, Page, Route } from '@playwright/test';
*
* Intercepted endpoints:
* - GET /v1/language, /v1/fiat, /v1/asset, /v1/bankAccount, /v1/country, /v1/setting/infoBanner
* - GET /v2/user (three synthetic kyc consent payloads)
* - GET /v2/user (five synthetic kyc payloads)
* - PUT/PATCH /v1/user, /v2/user (empty body so updateCallSettings cannot hit a real API)
*
* Synthetic fixtures: fake ids/addresses only — no production data.
Expand Down Expand Up @@ -190,4 +190,42 @@ test.describe('Settings Verification Call - Visual Regression Tests', () => {
maxDiffPixels: 5000,
});
});

test('completed call shows completion notice', async ({ page }) => {
await installSettingsRoutes(page, { phoneCallStatus: 'Completed' });

await page.goto(`/settings?session=${encodeURIComponent(token)}&lang=en&a=call`);
await expect(page.getByRole('heading', { name: 'Verification Call' })).toBeVisible({ timeout: 15_000 });
await page.waitForTimeout(1000);

await expect(
page.getByText('Your verification call has already been completed. There is nothing left to do.'),
).toBeVisible();
await expect(page.getByText('Verification may require a phone call. Should we call you?')).toHaveCount(0);
await expect(page.getByRole('button', { name: 'Request a new call' })).toHaveCount(0);

await expect(page).toHaveScreenshot('settings-verification-call-04-completed.png', {
fullPage: true,
maxDiffPixels: 5000,
});
});

test('failed call shows retry notice and button', async ({ page }) => {
await installSettingsRoutes(page, { phoneCallStatus: 'Failed' });

await page.goto(`/settings?session=${encodeURIComponent(token)}&lang=en&a=call`);
await expect(page.getByRole('heading', { name: 'Verification Call' })).toBeVisible({ timeout: 15_000 });
await page.waitForTimeout(1000);

await expect(
page.getByText('We were unable to reach you by phone. You can request a new call here.'),
).toBeVisible();
await expect(page.getByRole('button', { name: 'Request a new call' })).toBeVisible();
await expect(page.getByText('Verification may require a phone call. Should we call you?')).toHaveCount(0);

await expect(page).toHaveScreenshot('settings-verification-call-05-failed.png', {
fullPage: true,
maxDiffPixels: 5000,
});
});
});
2 changes: 1 addition & 1 deletion scripts/handbook/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
},
"settings-verification-call": {
"title": "Verifizierungsanruf (Settings)",
"description": "Settings-Sektion Verifizierungsanruf: ungesetzte Einwilligung (Platzhalter Auswählen), Ja mit bevorzugter Anrufzeit, und Nein ohne Zeitauswahl. Die Sektion ist der Ort, an dem Kundinnen den Anruf erlauben oder ablehnen."
"description": "Settings-Sektion Verifizierungsanruf: ungesetzte Einwilligung (Platzhalter Auswählen), Ja mit bevorzugter Anrufzeit, Nein ohne Zeitauswahl, Completed mit Abschlusshinweis und Failed mit Fehlerhinweis und Button für einen neuen Anruf."
},
"swap-process": {
"title": "Swap-Prozess",
Expand Down
Loading
Loading