fix(web): hide browser URL preview for player artists
ci / ts / ts (packages + web) (push) Successful in 4m37s
ci / ts / ts (packages + web) (push) Successful in 4m37s
This commit is contained in:
1 parent
7fa7ee2c7d
commit
eed7038109
3 files changed
+36
-7
No files matched your search
@@ -92,6 +92,31 @@ for (const [width, username] of [[320, 'mobile-admin'], [390, 'moderator'], [430
|
||||
});
|
||||
}
|
||||
|
||||
for (const width of [390, 1280]) {
|
||||
test(`player artist opens without a browser URL preview at ${width}px`, async ({ page }) => {
|
||||
await page.setViewportSize({ width: 390, height: 844 });
|
||||
await login(page, 'alice');
|
||||
await page.setViewportSize({ width, height: 844 });
|
||||
const box = page.getByRole('combobox', { name: 'Поиск', exact: true });
|
||||
await box.fill('кино');
|
||||
await box.press('Enter');
|
||||
await page.getByRole('link', { name: /Группа крови/ }).first().click();
|
||||
await page.getByRole('listitem').first().click();
|
||||
const artist = page.getByRole('contentinfo', { name: 'Плеер' }).getByRole('link', { name: 'Кино', exact: true });
|
||||
await artist.hover();
|
||||
await expect(artist).not.toHaveAttribute('href');
|
||||
expect(await artist.evaluate((el) => Boolean(el.closest('[title], a[href]')))).toBe(false);
|
||||
if (width === 390) {
|
||||
await artist.focus();
|
||||
await page.keyboard.press('Enter');
|
||||
} else {
|
||||
await artist.click();
|
||||
}
|
||||
await expect(page).toHaveURL(/\/artist\//);
|
||||
await expect(page.getByRole('heading', { name: 'Кино', exact: true })).toBeVisible();
|
||||
});
|
||||
}
|
||||
|
||||
test('mobile player keeps the island above navigation and exposes the queue', async ({ page }, info) => {
|
||||
await page.setViewportSize({ width: 320, height: 740 });
|
||||
await login(page, 'alice');
|
||||
|
||||
Reference in new issue
Block a user