mirror of
https://github.com/documenso/documenso.git
synced 2026-07-16 07:58:35 +10:00
138d663c25
Merge origin/main into feat/external-2fa-codes. Resolve formatting conflicts caused by biome rollout; preserve both feature streams: PR's external 2FA token + signing-session 2FA proof additions plus main's RateLimit/RecipientExpired/signingReminders/date-auto-insert. In complete-document-with-token.ts, drop the duplicate early field-fetching block introduced when main moved that logic later with date auto-insert support; keep the EXTERNAL_TWO_FACTOR_AUTH check using derivedRecipientActionAuth.
30 lines
1.0 KiB
TypeScript
30 lines
1.0 KiB
TypeScript
import type { Locator } from '@playwright/test';
|
|
import { expect, type Page } from '@playwright/test';
|
|
|
|
export const expectTextToBeVisible = async (page: Page, text: string) => {
|
|
await expect(page.getByText(text).first()).toBeVisible();
|
|
};
|
|
|
|
export const expectTextToNotBeVisible = async (page: Page, text: string) => {
|
|
await expect(page.getByText(text).first()).not.toBeVisible();
|
|
};
|
|
|
|
export const expectToastTextToBeVisible = async (page: Page, text: string) => {
|
|
await expect(page.locator('[role="status"]').getByText(text)).toBeVisible();
|
|
};
|
|
|
|
export const openDropdownMenu = async (page: Page, dropdownButton: Locator) => {
|
|
await page.waitForTimeout(500); // Initial timeout incase table remounts which will close the dropdown.
|
|
await dropdownButton.focus();
|
|
await page.keyboard.press('Enter');
|
|
|
|
await page.waitForTimeout(500);
|
|
await page.keyboard.press('Escape');
|
|
await page.waitForTimeout(500);
|
|
|
|
await dropdownButton.focus();
|
|
await page.keyboard.press('Enter');
|
|
|
|
await expect(page.getByRole('menuitem').first()).toBeVisible();
|
|
};
|