test: open the Offline settings page in the offline specs

This commit is contained in:
Linus Rath
2026-11-04 07:39:01 +01:00
parent 7ce57bedfd
commit 76acdfe1dd
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -98,11 +98,11 @@ async function setPolicy(browser: Browser, patch: { organisation?: Record<string
/** Settings > Backup & reset > Offline, switched on, and the first sync done. */
async function enableOffline(page: Page, phone = false): Promise<void> {
await page.goto('/settings/backup/offline');
await page.goto('/settings/offline');
const toggle = page.getByTestId('offline-switch');
if (phone && !(await toggle.waitFor({ state: 'visible', timeout: 8_000 }).then(() => true, () => false))) {
// On a phone the settings list may come first.
await page.getByText('Backup & reset', { exact: true }).first().click();
await page.getByTestId('settings-tab-offline').click();
}
await expect(toggle).toBeVisible({ timeout: 30_000 });
if ((await toggle.getAttribute('aria-checked')) !== 'true') await toggle.click();
+1 -1
View File
@@ -101,7 +101,7 @@ async function startOffline(): Promise<void> {
await expect(page.getByTestId('offline-banner')).toContainText("You're offline", { timeout: 60_000 });
// The shell can open Settings on its first page: from there through the menu, as a person would.
if (!(await page.getByTestId('offline-switch').waitFor({ state: 'visible', timeout: 5_000 }).then(() => true, () => false))) {
await page.getByText('Backup & reset', { exact: true }).first().click();
await page.getByTestId('settings-tab-offline').click();
}
await expect(page.getByTestId('offline-switch')).toBeVisible({ timeout: 30_000 });
}