Files pane and item buttons are icons, with the words in tooltips
Save, delete, view and download in the Files pane, and mark read, keep and open the original under an item's title, are icons now. The word is in each one's title and aria-label, so it is still there on hover and for screen readers. Tests find them by title or action, not text. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016HdTEWQNrzyFULijigkmMn
This commit is contained in:
@@ -78,7 +78,7 @@ test('the three panes are there and the item text lands in the bottom one', asyn
|
||||
const downloaded = page.locator('.ep', { hasText: 'downloaded' }).first();
|
||||
await downloaded.click();
|
||||
await expect(page.locator('#files audio')).toBeVisible();
|
||||
await expect(page.locator('#files .encbox .btn', { hasText: 'Save' })).toBeVisible();
|
||||
await expect(page.locator('#files .encbox [title="Save to this computer"]')).toBeVisible();
|
||||
|
||||
// Selecting another item replaces the pane rather than stacking.
|
||||
await page.locator('.ep', { hasText: 'First Episode' }).click();
|
||||
@@ -101,8 +101,8 @@ test('a downloaded file that is not audio gets no player', async ({ page }) => {
|
||||
await expect(page.locator('#files .encbox')).toContainText('image');
|
||||
await expect(page.locator('#files .encbox')).toContainText('downloaded');
|
||||
// Still offered as a file, just not as an episode: viewable and keepable.
|
||||
await expect(page.locator('#files .btn', { hasText: 'Save' })).toBeVisible();
|
||||
const view = page.locator('#files a', { hasText: 'View' });
|
||||
await expect(page.locator('#files [title="Save to this computer"]')).toBeVisible();
|
||||
const view = page.locator('#files a[title="View in a new tab"]');
|
||||
await expect(view).toHaveAttribute('target', '_blank');
|
||||
await expect(view).toHaveAttribute('rel', /noopener/);
|
||||
await expect(view).toHaveAttribute('href', /\/media\/\d+/);
|
||||
@@ -213,7 +213,7 @@ test('inside an OPML, feeds with unread items are listed first', async ({ page }
|
||||
await side.getByText('Grouped Show').click();
|
||||
const gs = page.locator('.ep', { hasText: 'Grouped Ep' });
|
||||
await gs.click();
|
||||
await page.locator('#detail button', { hasText: 'Mark unread' }).click();
|
||||
await page.locator('#detail button[title="Mark unread"]').click();
|
||||
await expect(gs).not.toHaveClass(/read/);
|
||||
|
||||
// Aardvark comes first alphabetically and in the OPML, so only the unread sort puts
|
||||
@@ -281,9 +281,9 @@ test('opening an item marks it read, and the toggle flips it back', async ({ pag
|
||||
// Another test may have opened this item already, so start from a known state: the
|
||||
// toggle in the text below flips it back -- which used to recurse until the stack blew.
|
||||
await row().click();
|
||||
await page.locator('#detail button', { hasText: 'Mark unread' }).click();
|
||||
await page.locator('#detail button[title="Mark unread"]').click();
|
||||
await expect(row()).not.toHaveClass(/read/);
|
||||
await expect(page.locator('#detail button', { hasText: 'Mark read' })).toBeVisible();
|
||||
await expect(page.locator('#detail button[title="Mark read"]')).toBeVisible();
|
||||
|
||||
// Opening it is reading it.
|
||||
await row().click();
|
||||
@@ -375,8 +375,9 @@ test('deleting a shared file warns that it is everyone\'s copy', async ({ page }
|
||||
await expect(row).toBeVisible({ timeout: 20_000 });
|
||||
await row.click();
|
||||
|
||||
const del = page.locator('#files button', { hasText: 'Delete' });
|
||||
await expect(del).toHaveText('Delete for everyone');
|
||||
// An icon now; what it does, and to whom, is in its tooltip.
|
||||
const del = page.locator('#files button[data-a="del"]');
|
||||
await expect(del).toHaveAttribute('title', /^Delete for everyone \(shared with 1 other person/);
|
||||
|
||||
// Two prompts: the page's own, then the server's, because someone else has not played
|
||||
// it. Accept the first, decline the second, and the file must survive.
|
||||
@@ -657,12 +658,12 @@ test('a deleted file looks as if it was never downloaded', async ({ page }) => {
|
||||
const row = page.locator('.ep', { hasText: 'An Article' });
|
||||
await expect(row).toBeVisible({ timeout: 20_000 });
|
||||
await row.click();
|
||||
await page.locator('#files button', { hasText: 'Delete' }).click();
|
||||
await page.locator('#files button[data-a="del"]').click();
|
||||
|
||||
// No "reaped", no chip at all: just the way to get it again.
|
||||
await expect(row).not.toContainText('downloaded');
|
||||
await expect(row).not.toContainText(/reaped/i);
|
||||
await row.click();
|
||||
await expect(page.locator('#files')).not.toContainText(/reaped/i);
|
||||
await expect(page.locator('#files .btn', { hasText: 'Download' })).toBeVisible();
|
||||
await expect(page.locator('#files button[title="Download to the server"]')).toBeVisible();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user