test(e2e): sign-in methods matrix — change-email + link/unlink Telegram
CI / changes (pull_request) Successful in 2s
CI / unit (pull_request) Successful in 10s
CI / integration (pull_request) Successful in 19s
CI / ui (pull_request) Successful in 1m4s
CI / conformance (pull_request) Successful in 9s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 1m37s
CI / changes (pull_request) Successful in 2s
CI / unit (pull_request) Successful in 10s
CI / integration (pull_request) Successful in 19s
CI / ui (pull_request) Successful in 1m4s
CI / conformance (pull_request) Successful in 9s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 1m37s
Replace the stale skipped linking specs: change-email refuses a taken address with the non-disclosing message (never revealing the other account) and replaces a free one; the web Telegram link control links then unlinks through the confirm dialog. Chromium + WebKit.
This commit is contained in:
+40
-16
@@ -292,32 +292,56 @@ test('profile edit disables Save and flags an invalid display name', async ({ pa
|
|||||||
await expect(save).toBeEnabled();
|
await expect(save).toBeEnabled();
|
||||||
});
|
});
|
||||||
|
|
||||||
// The email upgrade box is now shown to guests (email bind + the merge dialog). These specs
|
// The profile's sign-in-methods matrix (email add/change + provider link/unlink). The mock
|
||||||
// still assume a non-guest login and the visible Telegram control, so they stay skipped until
|
// profile is a durable account already holding an email, so the email control is the change
|
||||||
// PR2 re-enables provider linking and adds a guest-login setup.
|
// flow; a new address containing "taken" stands in (in the mock) for one owned by another
|
||||||
test.skip('link account: a taken email opens the irreversible merge confirmation', async ({ page }) => {
|
// account, driving the non-disclosing refusal.
|
||||||
|
test('change email: a taken address is refused without disclosure', async ({ page }) => {
|
||||||
await loginLobby(page);
|
await loginLobby(page);
|
||||||
await openProfile(page);
|
await openProfile(page);
|
||||||
|
|
||||||
// The email box is shown to guests (this spec needs a guest login — re-enabled in PR2).
|
await expect(page.getByText('you@example.com')).toBeVisible();
|
||||||
await expect(page.getByRole('heading', { name: 'Link an account' })).toBeVisible();
|
await page.getByRole('button', { name: 'Change' }).click();
|
||||||
// An address containing "merge" stands in (in the mock) for one already owned by
|
await page.getByPlaceholder('New email address').fill('taken@example.com');
|
||||||
// another account, so the confirm step reveals a required merge.
|
|
||||||
await page.locator('.emailbox input[type="email"]').fill('merge@example.com');
|
|
||||||
await page.getByRole('button', { name: 'Send code' }).click();
|
await page.getByRole('button', { name: 'Send code' }).click();
|
||||||
await page.locator('.emailbox .codein').fill('123456');
|
await page.locator('.accounts .codein').fill('123456');
|
||||||
await page.getByRole('button', { name: 'OK' }).click();
|
await page.getByRole('button', { name: 'OK' }).click();
|
||||||
|
|
||||||
// The reveal happens only after the code, and names the other account.
|
// The neutral message never reveals the other account.
|
||||||
await expect(page.getByText('Merge accounts?')).toBeVisible();
|
await expect(page.getByText('Check the address or contact support.')).toBeVisible();
|
||||||
await expect(page.getByText(/Ann/)).toBeVisible();
|
await expect(page.getByText(/belongs to another account/)).toHaveCount(0);
|
||||||
await page.getByRole('button', { name: 'Merge' }).click();
|
await expect(page.getByText('you@example.com')).toBeVisible();
|
||||||
await expect(page.getByText('Merge accounts?')).toBeHidden();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
test.skip('link account: the Telegram web sign-in control is offered in a browser', async ({ page }) => {
|
test('change email: a free address replaces the current one', async ({ page }) => {
|
||||||
await loginLobby(page);
|
await loginLobby(page);
|
||||||
await openProfile(page);
|
await openProfile(page);
|
||||||
|
|
||||||
|
await page.getByRole('button', { name: 'Change' }).click();
|
||||||
|
await page.getByPlaceholder('New email address').fill('fresh@example.com');
|
||||||
|
await page.getByRole('button', { name: 'Send code' }).click();
|
||||||
|
await page.locator('.accounts .codein').fill('123456');
|
||||||
|
await page.getByRole('button', { name: 'OK' }).click();
|
||||||
|
|
||||||
|
await expect(page.getByText('fresh@example.com')).toBeVisible();
|
||||||
|
await expect(page.getByText('you@example.com')).toHaveCount(0);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('link then unlink Telegram from the sign-in methods', async ({ page }) => {
|
||||||
|
await loginLobby(page);
|
||||||
|
await openProfile(page);
|
||||||
|
|
||||||
|
// On the web the Telegram login-widget control is offered; the mock links it instantly.
|
||||||
|
await page.getByRole('button', { name: 'Link Telegram' }).click();
|
||||||
|
const tgRow = page.locator('.acctrow').filter({ hasText: 'Telegram' });
|
||||||
|
await expect(tgRow).toBeVisible();
|
||||||
|
|
||||||
|
// With email + Telegram two methods remain, so Unlink is offered; confirm it in the dialog.
|
||||||
|
await tgRow.getByRole('button', { name: 'Unlink' }).click();
|
||||||
|
await expect(page.getByText('Unlink account?')).toBeVisible();
|
||||||
|
await page.getByRole('dialog').getByRole('button', { name: 'Unlink' }).click();
|
||||||
|
|
||||||
|
await expect(page.locator('.acctrow').filter({ hasText: 'Telegram' })).toHaveCount(0);
|
||||||
await expect(page.getByRole('button', { name: 'Link Telegram' })).toBeVisible();
|
await expect(page.getByRole('button', { name: 'Link Telegram' })).toBeVisible();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user