Add floating synced lyrics with picture-in-picture fallback
This commit is contained in:
@@ -22,3 +22,14 @@ for (const layout of ['classic', 'glass-stage']) for (const width of [390, 1440]
|
||||
const overflow = await page.locator('.settings-browser').evaluate(el => el.scrollWidth > el.clientWidth + 1); expect(overflow).toBe(false);
|
||||
});
|
||||
}
|
||||
test('floating lyrics move the real view and restore it on close', async ({ page }) => {
|
||||
await page.addInitScript(() => { window.documentPictureInPicture = { requestWindow: async () => window.open('about:blank', 'lyrics-test', 'width=420,height=500') }; });
|
||||
await openClassic(page);
|
||||
const popupPromise = page.waitForEvent('popup');
|
||||
await page.locator('#stageLyricsAuto').evaluate(el => el.nextElementSibling.click());
|
||||
const popup = await popupPromise;
|
||||
await expect(popup.locator('#stageLyrics')).toBeVisible();
|
||||
await expect(popup.getByRole('button', { name: 'Play / Pause', exact: true })).toBeVisible();
|
||||
await expect(page.locator('#stageLyrics')).toHaveCount(0);
|
||||
await popup.close(); await expect(page.locator('#stageLyrics')).toHaveCount(1);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user