test(review): #90 assert Primary photo src is valid + checkerboard on strip
Locks in the two live-bug fixes: the Primary (leftmost kept) photo's <img src> must be a real URL (blob: for an in-memory capture blob) and never empty/ "object Blob"; and each strip card must carry the gray checkerboard background matching the Capture lineup.
This commit is contained in:
@@ -200,6 +200,18 @@ test.describe('M3 Review photo strip (#90)', () => {
|
||||
await expect(cards.nth(0)).toHaveAttribute('data-primary', 'true');
|
||||
await expect(page.getByText('PRIMARY', { exact: true })).toHaveCount(1);
|
||||
|
||||
// Bug #1 regression: the primary photo's <img src> must be a valid URL
|
||||
// (blob: for an in-memory capture blob), never empty or "object Blob".
|
||||
const primaryImg = cards.nth(0).locator('img');
|
||||
await expect(primaryImg).not.toHaveAttribute('src', /object Blob|^$/);
|
||||
const src = await primaryImg.getAttribute('src');
|
||||
expect(src && src.length > 4).toBeTruthy();
|
||||
|
||||
// Bug #2 regression: the card carries the gray checkerboard background
|
||||
// (matching the Capture lineup), not a flat color.
|
||||
const bgImage = await cards.nth(0).evaluate((el) => getComputedStyle(el).backgroundImage);
|
||||
expect(bgImage).toContain('45deg');
|
||||
|
||||
// Remove the primary (cal) → primary auto-promotes to the next leftmost (ov).
|
||||
await cards.nth(0).click();
|
||||
await expect(cards.nth(0)).toHaveAttribute('aria-pressed', 'false');
|
||||
|
||||
Reference in New Issue
Block a user