A kept episode's row says On this device (#413)
Only the keep button in the files pane said an episode was kept, so finding what was on the device meant opening items one by one. The row's line says it, and keeping or removing one redraws the rows whose state changed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RqkrVDqdiQEMWAkNGQ2tYA
This commit is contained in:
@@ -147,16 +147,21 @@ test('an episode kept on the device plays from it offline, and its place waits t
|
||||
};
|
||||
await open();
|
||||
const keep = page.locator('#files [data-a="offline"]');
|
||||
const row = page.locator('.ep', { hasText: 'Listen on a Plane' });
|
||||
await expect(keep).toHaveAttribute('aria-pressed', 'false');
|
||||
await expect(row.locator('.kept')).toHaveCount(0);
|
||||
await keep.click();
|
||||
await expect(keep).toHaveAttribute('aria-pressed', 'true', { timeout: 15_000 });
|
||||
expect(await cacheSize(page, 'ipx-episodes')).toBe(1);
|
||||
// Its row in the list says so too (#413).
|
||||
await expect(row.locator('.kept')).toHaveText('On this device');
|
||||
|
||||
await context.setOffline(true);
|
||||
await page.reload();
|
||||
await open();
|
||||
// Still kept, as the page reads it from the cache at start.
|
||||
await expect(keep).toHaveAttribute('aria-pressed', 'true');
|
||||
await expect(row.locator('.kept')).toBeVisible();
|
||||
await page.locator('#files [data-a="play"]').click();
|
||||
await expect.poll(() => page.evaluate(() => audio.currentTime), { timeout: 15_000 }).toBeGreaterThan(0.3);
|
||||
expect(await page.evaluate(() => audio.currentSrc)).toContain('?offline');
|
||||
@@ -178,6 +183,7 @@ test('an episode kept on the device plays from it offline, and its place waits t
|
||||
await keep.click();
|
||||
await expect(keep).toHaveAttribute('aria-pressed', 'false');
|
||||
expect(await cacheSize(page, 'ipx-episodes')).toBe(0);
|
||||
await expect(row.locator('.kept')).toHaveCount(0);
|
||||
});
|
||||
|
||||
test('a kept episode is answered in the byte ranges a player asks for', async ({ page, context }) => {
|
||||
|
||||
Reference in New Issue
Block a user