Files
kandev/apps/web/e2e/pages/task-description-editor.ts
T
2026-09-13 16:59:54 +01:00

17 lines
636 B
TypeScript

import { expect, type Locator } from "@playwright/test";
export async function readTaskDescription(input: Locator): Promise<string> {
return input.evaluate((element) => {
if (element instanceof HTMLInputElement || element instanceof HTMLTextAreaElement) {
return element.value;
}
const serializedValue = element.getAttribute("data-task-description-value");
if (serializedValue !== null) return serializedValue;
return element.innerText;
});
}
export async function expectTaskDescription(input: Locator, value: string): Promise<void> {
await expect.poll(() => readTaskDescription(input)).toBe(value);
}