refactor: cloak elements that need alpine loaded

This commit is contained in:
Robert Perce 2026-04-08 09:27:14 -05:00
parent 7b70a10463
commit 231eee3e10
7 changed files with 16 additions and 17 deletions

View file

@ -16,9 +16,7 @@ type UserFields = {
};
export const verifyCreateUser = async (page: Page, fields: UserFields) => {
await page.getByRole('button', { name: /add contact/i }).click();
await page.waitForResponse('/contact/new');
await expect(page.locator('#alpine-loaded')).not.toHaveAttribute('x-cloak');
await page.waitForURL(/contact\/\d+\/edit$/);
const { names, ...simple } = fields;
for (const name of (names ?? [])) {
@ -31,6 +29,6 @@ export const verifyCreateUser = async (page: Page, fields: UserFields) => {
}
await page.getByRole('button', { name: /save/i }).click();
await page.waitForResponse(/\/contact\/\d+/);
await page.waitForURL(/contact\/\d+$/);
};