Admin page: Save waits for a change, and the phone layout fits (#414)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RqkrVDqdiQEMWAkNGQ2tYA
This commit is contained in:
2026-11-07 17:16:23 +00:00
parent c6dcb7f34e
commit b209f55d2c

View File

@@ -231,10 +231,13 @@ test('the admin page saves the global schedule', async ({ page }) => {
await page.locator('#admin').click(); await page.locator('#admin').click();
await expect(page).toHaveURL(/\/admin$/); await expect(page).toHaveURL(/\/admin$/);
await expect(page.locator('#atabs a.on')).toHaveText('Server'); 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('#gnum').fill('4');
await page.locator('#gunit').selectOption('h'); await page.locator('#gunit').selectOption('h');
await page.locator('#gsave').click(); await page.locator('#gsave').click();
await expect(page.locator('#toasts')).toContainText('Settings saved'); 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. // It must survive a reload, i.e. actually reach the config.
await page.reload(); await page.reload();
@@ -247,6 +250,19 @@ test('the admin page saves the global schedule', async ({ page }) => {
await expect(page.locator('#gnum')).toHaveCount(0); 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 }) => { test('episodes show with their metadata, and the text opens below', async ({ page }) => {
await page.locator('.feed', { hasText: 'Test Show' }).click(); await page.locator('.feed', { hasText: 'Test Show' }).click();
await expect(page.locator('.ep').first()).toBeVisible({ timeout: 20_000 }); await expect(page.locator('.ep').first()).toBeVisible({ timeout: 20_000 });