mirror of
https://github.com/bulwarkmail/webmail.git
synced 2026-11-05 08:16:22 +00:00
test: open the Offline settings page in the offline specs
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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 });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user