mirror of
https://github.com/nikdoof/pocket-id.git
synced 2025-12-13 23:02:17 +00:00
22 lines
821 B
TypeScript
22 lines
821 B
TypeScript
import test, { expect } from '@playwright/test';
|
|
import { oneTimeAccessTokens } from './data';
|
|
|
|
// Disable authentication for these tests
|
|
test.use({ storageState: { cookies: [], origins: [] } });
|
|
|
|
test('Sign in with one time access token', async ({ page }) => {
|
|
const token = oneTimeAccessTokens.filter((t) => !t.expired)[0];
|
|
await page.goto(`/login/${token.token}`);
|
|
|
|
await page.getByRole('button', { name: 'Continue' }).click();
|
|
await page.waitForURL('/settings/account');
|
|
});
|
|
|
|
test('Sign in with expired one time access token fails', async ({ page }) => {
|
|
const token = oneTimeAccessTokens.filter((t) => t.expired)[0];
|
|
await page.goto(`/login/${token.token}`);
|
|
|
|
await page.getByRole('button', { name: 'Continue' }).click();
|
|
await expect(page.getByRole('status')).toHaveText('Token is invalid or expired');
|
|
});
|