Keep is a button on the show's page, a plus, not a switch in its settings (#280)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -497,30 +497,22 @@ test('a show inside an OPML can be kept, and only it', async ({ page }) => {
|
||||
await expect(chev).toBeVisible({ timeout: 20_000 });
|
||||
if (await chev.getAttribute('aria-expanded') === 'false') await chev.click();
|
||||
await page.locator('#feedlist').getByText('Aardvark Radio').click();
|
||||
await page.locator('#content .acts [data-a="settings"]').click();
|
||||
|
||||
// Saved settings on a show would stop it following the OPML's for later tests, so the save is
|
||||
// caught here and only what it would send is checked (#280).
|
||||
let sent = null;
|
||||
await page.route('**/api/feeds/*', (route) => {
|
||||
if (route.request().method() !== 'PATCH') return route.continue();
|
||||
sent = route.request().postDataJSON();
|
||||
return route.fulfill({ status: 204 });
|
||||
});
|
||||
const keep = page.locator('#skept');
|
||||
await expect(keep).not.toBeChecked();
|
||||
await expect(page.locator('#modalCard')).toContainText('Test Subscriptions stops listing it');
|
||||
await keep.check({ force: true });
|
||||
await page.locator('#ssave').click();
|
||||
await expect.poll(() => sent && sent.kept).toBe(true);
|
||||
await page.unroute('**/api/feeds/*');
|
||||
// A plus on the show's page; pressed, a check (#280).
|
||||
const keep = page.locator('#content .acts [data-a="keep"]');
|
||||
await expect(keep).toHaveAttribute('aria-pressed', 'false');
|
||||
await expect(keep).toHaveAttribute('title', /Test Subscriptions drops it/);
|
||||
await keep.click();
|
||||
await expect(keep).toHaveAttribute('aria-pressed', 'true');
|
||||
const kept = await page.evaluate(() => fetch('/api/feeds').then((r) => r.json()));
|
||||
expect((kept.feeds || kept).find((f) => f.title === 'Aardvark Radio')?.kept).toBe(true);
|
||||
await keep.click();
|
||||
await expect(keep).toHaveAttribute('aria-pressed', 'false');
|
||||
|
||||
// The OPML's own settings have no Keep.
|
||||
await page.keyboard.press('Escape');
|
||||
// The OPML itself has no Keep.
|
||||
await page.locator('.feed', { hasText: 'Test Subscriptions' }).first().click();
|
||||
await page.locator('#content .acts [data-a="settings"]').click();
|
||||
await expect(page.locator('#modalCard')).toBeVisible();
|
||||
await expect(page.locator('#skept')).toHaveCount(0);
|
||||
await expect(page.locator('.childrow').first()).toBeVisible();
|
||||
await expect(page.locator('#content [data-a="keep"]')).toHaveCount(0);
|
||||
});
|
||||
|
||||
test('marking an OPML subscription read covers the feeds inside it', async ({ page }) => {
|
||||
|
||||
Reference in New Issue
Block a user