undo(tests): Undo bad changes to tests/helpers.ts suggested by CodeRabbit.ai

This commit is contained in:
Richard R 2026-04-06 10:34:59 -06:00
parent 97dba6d987
commit dbd202569f

View file

@ -95,6 +95,8 @@ export async function uploadAndDisplay(page: Page, fileName: string) {
break; break;
} catch (error) { } catch (error) {
if (attempt === 2) throw error; if (attempt === 2) throw error;
const message = String(error);
if (!message.includes('intercepts pointer events')) throw error;
await page.waitForTimeout(200); await page.waitForTimeout(200);
} }
} }
@ -116,18 +118,15 @@ async function dismissSettingsModalIfVisible(page: Page): Promise<void> {
const saveBtn = settingsDialog.getByRole('button', { name: 'Save' }); const saveBtn = settingsDialog.getByRole('button', { name: 'Save' });
const saveVisible = await saveBtn.isVisible().catch(() => false); const saveVisible = await saveBtn.isVisible().catch(() => false);
if (saveVisible) { if (saveVisible) {
const saveEnabled = await saveBtn.isEnabled(); await expect(saveBtn).toBeEnabled({ timeout: 10000 }).catch(() => { });
if (saveEnabled) { await saveBtn.click({ force: true }).catch(async () => {
await saveBtn.focus(); await page.keyboard.press('Escape').catch(() => { });
await page.keyboard.press('Enter'); });
} else {
await page.keyboard.press('Escape');
}
} else { } else {
await page.keyboard.press('Escape'); await page.keyboard.press('Escape').catch(() => { });
} }
await settingsDialog.waitFor({ state: 'hidden', timeout: 15000 }); await settingsDialog.waitFor({ state: 'hidden', timeout: 15000 }).catch(() => { });
} }
/** /**