Show toasts above Service mode so the report-needs-a-profile message is visible
This commit is contained in:
@@ -1292,7 +1292,7 @@ input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.25); }
|
|||||||
bottom: 26px;
|
bottom: 26px;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
transform: translateX(-50%);
|
transform: translateX(-50%);
|
||||||
z-index: 200;
|
z-index: 460; /* above Service mode (320) and the report sheet (450) so its messages are seen */
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column-reverse;
|
flex-direction: column-reverse;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|||||||
@@ -81,3 +81,17 @@ for (const layout of ['classic', 'glass-stage']) for (const width of [390,1440])
|
|||||||
await page.getByRole('button',{name:'Add current 8 s to practice',exact:true}).click();await expect(page.locator('.piano-practice button').first()).toHaveText('Loop 0.0–8.0 s');
|
await page.getByRole('button',{name:'Add current 8 s to practice',exact:true}).click();await expect(page.locator('.piano-practice button').first()).toHaveText('Loop 0.0–8.0 s');
|
||||||
expect(models).toEqual([]);expect(await page.locator('#settings-section-piano').evaluate(el=>el.scrollWidth<=el.clientWidth+1)).toBe(true);
|
expect(models).toEqual([]);expect(await page.locator('#settings-section-piano').evaluate(el=>el.scrollWidth<=el.clientWidth+1)).toBe(true);
|
||||||
});
|
});
|
||||||
|
test('Service mode report: the "link a profile" message shows above the overlay, and a linked profile opens the sheet', async ({ page }) => {
|
||||||
|
await page.setViewportSize({ width: 1440, height: 900 }); await openClassic(page);
|
||||||
|
await page.route('**/api/notes/0gfX0dFLaBc', route => route.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok:true, lyrics:{rev:1,data:{offset:0,lines:[{t:0,text:'Line one',kind:'line'},{t:5,text:'Line two',kind:'line'}]}}, chapters:null }) }));
|
||||||
|
await page.route('**/api/notes/0gfX0dFLaBc/flags*', route => route.fulfill({ contentType: 'application/json', body: '{"flags":[]}' }));
|
||||||
|
await page.evaluate(async () => { data.profile = null; current = {meta:{id:'0gfX0dFLaBc',title:'Fixture'}}; await Notes.load(current.meta); data.settings.serviceLyrics = true; $('serviceMode').classList.remove('hidden'); Notes.serviceRefresh(); });
|
||||||
|
await page.locator('#serviceFlagBtn').click({ force: true });
|
||||||
|
await page.locator('#serviceLyricsList .sl-line').nth(1).click({ force: true });
|
||||||
|
const toast = page.locator('.toast', { hasText: 'Link an online profile' });
|
||||||
|
await expect(toast).toBeVisible();
|
||||||
|
expect(await toast.evaluate(el => { const r = el.getBoundingClientRect(); const t = document.elementFromPoint(r.x + r.width / 2, r.y + r.height / 2); return el.contains(t); })).toBe(true);
|
||||||
|
await page.evaluate(() => { data.profile = { name: 'tester' }; });
|
||||||
|
await page.locator('#serviceLyricsList .sl-line').nth(1).click({ force: true });
|
||||||
|
await expect(page.locator('.fs-backdrop')).toHaveCount(1);
|
||||||
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user