test(e2e): the drag onto the rail waits for the rail's lists
This commit is contained in:
@@ -66,11 +66,13 @@ async function carry(page: Page, grip: Locator, to: { x: number; y: number }) {
|
|||||||
|
|
||||||
/** The same onto the rail. An unpinned one is a tab until the drag's own hover peeks it open. */
|
/** The same onto the rail. An unpinned one is a tab until the drag's own hover peeks it open. */
|
||||||
async function carryToRail(page: Page, grip: Locator, target: Locator) {
|
async function carryToRail(page: Page, grip: Locator, target: Locator) {
|
||||||
|
const tab = page.getByRole("button", { name: "Pin Playlists open" });
|
||||||
|
// The rail's lists answer after the rows: until then a pinned rail shows neither the list nor a tab.
|
||||||
|
await target.or(tab).first().waitFor();
|
||||||
if (await target.isVisible()) {
|
if (await target.isVisible()) {
|
||||||
await carry(page, grip, await centre(target));
|
await carry(page, grip, await centre(target));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const tab = page.getByRole("button", { name: "Pin Playlists open" });
|
|
||||||
await carry(page, grip, await centre(tab));
|
await carry(page, grip, await centre(tab));
|
||||||
await expect(target).toBeVisible();
|
await expect(target).toBeVisible();
|
||||||
await page.mouse.move(...(Object.values(await centre(target)) as [number, number]), { steps: 6 });
|
await page.mouse.move(...(Object.values(await centre(target)) as [number, number]), { steps: 6 });
|
||||||
|
|||||||
Reference in New Issue
Block a user