mirror of
https://github.com/block/buzz.git
synced 2026-08-18 06:50:31 +02:00
Signed-off-by: Wes <wesbillman@users.noreply.github.com> Co-authored-by: Brain <21994759fc7a6fa6b965551d35cfd7897d262f2495467f2d78694ddcfa6a5c7e@sprout-oss.stage.blox.sqprod.co>
25 lines
847 B
TypeScript
25 lines
847 B
TypeScript
import type { Page } from "@playwright/test";
|
|
import { expect } from "@playwright/test";
|
|
|
|
export const E2E_IDENTITY_OVERRIDE_STORAGE_KEY =
|
|
"buzz:e2e-identity-override.v1";
|
|
|
|
export async function seedActiveIdentity(
|
|
page: Page,
|
|
identity: { privateKey: string; pubkey: string; username: string },
|
|
) {
|
|
await page.addInitScript(
|
|
({ identity: nextIdentity, storageKey }) => {
|
|
window.localStorage.setItem(storageKey, JSON.stringify(nextIdentity));
|
|
},
|
|
{ identity, storageKey: E2E_IDENTITY_OVERRIDE_STORAGE_KEY },
|
|
);
|
|
}
|
|
|
|
/** Navigate through the backup step (fresh-key path). */
|
|
export async function passThroughBackupStep(page: Page) {
|
|
await expect(page.getByTestId("onboarding-page-backup")).toBeVisible();
|
|
await expect(page.getByTestId("nsec-value")).toBeVisible();
|
|
await page.getByTestId("onboarding-next").click();
|
|
}
|