Skip to content

Commit

Permalink
fix: Demo page screenshot path (#76)
Browse files Browse the repository at this point in the history
  • Loading branch information
gt2345 authored Dec 12, 2023
1 parent d50a4c4 commit e4fb70c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions scripts/designkit-screenshot.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const browser = await chromium.launch();
const page = await browser.newPage();
await page.goto(`http://${address}:${port}${publicUrl}/design/?exclusive=true`);
// take screenshots of each section
const links = await page.locator('nav ul a').all();
const links = await page.locator('#main-nav ul a').all();
if (links.length === 0) {
console.error('WARNING: No sections found');
}
Expand All @@ -40,7 +40,7 @@ for (const theme of THEMES) {
for (const link of links) {
await link.click();
const title = await link.innerText();
const section = page.locator('div > article > article');
const section = page.locator('article');
// playwright hangs if height is a non-int
const height = Math.ceil((await section.boundingBox()).height);
await page.setViewportSize({ height, width: 1280 });
Expand Down
2 changes: 1 addition & 1 deletion src/DesignKit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4588,7 +4588,7 @@ const DesignKit: React.FC<{
<UIProvider priority="low" theme={theme} themeIsDark={themeIsDark}>
<Spinner spinning={false}>
<ElevationWrapper className={css.base} elevationOverride={0}>
<ElevationWrapper className={[css.nav, css.desktop].join(' ')}>
<ElevationWrapper className={[css.nav, css.desktop].join(' ')} id="main-nav">
<ul className={css.sections}>
<li>
<ThemeToggle mode={mode} onChange={onChangeMode} />
Expand Down

0 comments on commit e4fb70c

Please sign in to comment.