diff --git a/tests/ui/app.spec.ts b/tests/ui/app.spec.ts index 537ba76..81e3096 100644 --- a/tests/ui/app.spec.ts +++ b/tests/ui/app.spec.ts @@ -231,10 +231,13 @@ test('the admin page saves the global schedule', async ({ page }) => { await page.locator('#admin').click(); await expect(page).toHaveURL(/\/admin$/); await expect(page.locator('#atabs a.on')).toHaveText('Server'); + // Save waits for a change, and says once more that there is none once it is saved (#414). + await expect(page.locator('#gsave')).toBeDisabled(); await page.locator('#gnum').fill('4'); await page.locator('#gunit').selectOption('h'); await page.locator('#gsave').click(); await expect(page.locator('#toasts')).toContainText('Settings saved'); + await expect(page.locator('#gsave')).toBeDisabled(); // It must survive a reload, i.e. actually reach the config. await page.reload(); @@ -247,6 +250,19 @@ test('the admin page saves the global schedule', async ({ page }) => { await expect(page.locator('#gnum')).toHaveCount(0); }); +test('on a phone the admin page tabs and account rows fit the screen', async ({ page }) => { + // At 390 px the tabs ran off the edge and hid Log (#414): they take a row of their own now. + await page.setViewportSize({ width: 390, height: 844 }); + await page.goto('/admin#accounts'); + const row = page.locator('#accounts [data-id]').first(); + await expect(row).toBeVisible(); + for (const el of [...await page.locator('#atabs a').all(), row.locator('[data-a="admin"]'), row.locator('[data-a="rm"]')]) { + const box = (await el.boundingBox())!; + expect(box.x + box.width, await el.evaluate(e => e.outerHTML.slice(0, 60))).toBeLessThanOrEqual(390); + } + expect(await page.evaluate(() => document.documentElement.scrollWidth)).toBeLessThanOrEqual(390); +}); + test('episodes show with their metadata, and the text opens below', async ({ page }) => { await page.locator('.feed', { hasText: 'Test Show' }).click(); await expect(page.locator('.ep').first()).toBeVisible({ timeout: 20_000 });