Skip to content

Commit 95945bb

Browse files
committed
evidence: target the story's sized wrapper (not for merge)
1 parent d128703 commit 95945bb

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎.github/scratch-14182/capture.mjs‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ for (const side of ['base', 'head']) {
2121
const context = await browser.newContext({viewport: {width, height: 700}, deviceScaleFactor: 2, reducedMotion: 'reduce'});
2222
const page = await context.newPage();
2323
await page.goto(`${origin}/iframe.html?id=${story}&viewMode=story`);
24-
const root = page.locator('#storybook-root > *').first();
24+
// The story's own sized wrapper; the theme wrapper above it is display: contents.
25+
const root = page.locator('#storybook-root div[style*="width"]').first();
2526
await root.waitFor();
2627
await settle(page);
2728
const hint = await page.evaluate(() => [...document.querySelectorAll('p, span')].map(e => e.textContent.trim()).find(t => t.startsWith('Touch press-and-hold')) ?? 'none');

0 commit comments

Comments
 (0)