Directory: chips by kind and category over a grid of cover art
Feeds take their channel's first <itunes:category> into a new feeds.category column; the migration drops ETag and Last-Modified once so every feed re-reads on its normal schedule and picks one up. /api/popular and /api/directory carry category and podcast (any audio or video enclosure). Directory becomes a grid of cover-art tiles under a chip rail: All, Podcasts, Blogs, and a podcast's categories once Podcasts is picked. Popular and Add a feed keep their rows. Closes #4, closes #5, closes #6, closes #7. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -695,25 +695,42 @@ test('Popular lists what everyone here reads, but never a private feed', async (
|
||||
expect(top.every(t => ids.includes(t.id))).toBe(true);
|
||||
expect(ids).not.toContain('paid-show');
|
||||
|
||||
// Subscribe from the directory this time; the popular list shares the same rows.
|
||||
// Subscribe from the directory this time: the same feeds, as a grid of cover art.
|
||||
const tiles = piper.locator('#popular .tile');
|
||||
const chip = name => piper.locator('#chips button', { hasText: new RegExp(`^${name}$`) });
|
||||
await piper.locator('#feedlist .place', { hasText: 'Directory' }).click();
|
||||
await expect(piper.locator('#count')).toContainText(`Directory: ${dir.length} feed`);
|
||||
await expect(offered.filter({ hasText: 'Test Show' })).toBeVisible();
|
||||
await expect(offered.filter({ hasText: /Grouped Show|grouped-show/ })).toBeVisible();
|
||||
await expect(offered.filter({ hasText: /Test Subscriptions/ })).toHaveCount(0);
|
||||
await expect(offered.filter({ hasText: /Paid Show|paid-show/ })).toHaveCount(0);
|
||||
await expect(tiles.filter({ hasText: 'Test Show' })).toBeVisible();
|
||||
await expect(tiles.filter({ hasText: /Grouped Show|grouped-show/ })).toBeVisible();
|
||||
await expect(tiles.filter({ hasText: /Test Subscriptions/ })).toHaveCount(0);
|
||||
await expect(tiles.filter({ hasText: /Paid Show|paid-show/ })).toHaveCount(0);
|
||||
await expect(tiles).toHaveCount(dir.length);
|
||||
|
||||
// What a feed is before what it is about: a podcast's categories open under Podcasts.
|
||||
expect(dir.find(p => p.id === 'test-show')).toMatchObject({ podcast: true, category: 'Technology' });
|
||||
expect(dir.find(p => p.id === 'picture-blog')).toMatchObject({ podcast: false });
|
||||
await expect(chip('Technology')).toHaveCount(0);
|
||||
await chip('Blogs').click();
|
||||
await expect(tiles).toHaveCount(dir.filter(p => !p.podcast).length);
|
||||
await expect(tiles.filter({ hasText: 'Test Show' })).toHaveCount(0);
|
||||
await chip('Podcasts').click();
|
||||
await chip('Technology').click();
|
||||
await expect(chip('Technology')).toHaveAttribute('aria-pressed', 'true');
|
||||
await expect(tiles).toHaveCount(dir.filter(p => p.podcast && p.category === 'Technology').length);
|
||||
await chip('All').click();
|
||||
await expect(tiles).toHaveCount(dir.length);
|
||||
|
||||
// Add a feed opened over Directory fills its own list, not the pane behind it.
|
||||
await piper.locator('#addFeed').click();
|
||||
await expect(piper.locator('#modalCard .childrow', { hasText: 'Test Show' })).toBeVisible();
|
||||
await expect(offered).toHaveCount(dir.length);
|
||||
await expect(tiles).toHaveCount(dir.length);
|
||||
await piper.locator('#modalCard button[title="Cancel"]').click();
|
||||
|
||||
const row = async () =>
|
||||
(await (await piper.request.get('/api/popular')).json()).find(p => p.id === 'test-show');
|
||||
const before = await row();
|
||||
expect(before.subscribed).toBe(false);
|
||||
await offered.filter({ hasText: 'Test Show' }).locator('button[title="Subscribe"]').click();
|
||||
await tiles.filter({ hasText: 'Test Show' }).locator('button[title="Subscribe"]').click();
|
||||
await expect(piper.locator('#feedlist .feed', { hasText: 'Test Show' })).toBeVisible({ timeout: 20_000 });
|
||||
|
||||
// Everyone counts, you included: it stays listed, marked as yours, with one more subscriber.
|
||||
|
||||
Reference in New Issue
Block a user