test(sw): align home menu integration with current stories

This commit is contained in:
shkim4 committed 2026-10-20 22:19:49 +09:00
1 parent 553e4df4a8
commit 7fd73425c5
1 file changed
+4 -2
@@ -160,14 +160,16 @@ check('every width: no horizontal scroll in the menu; 5 sections = row + More (1
responsive.every(r => !r.scrolls && r.rowSections + r.moved === 5 && (r.width !== 1920 || r.moved === 0)), responsive)
// 8. Without homeMenu (existing Header): the logo still calls onHomeClick only, no menu, no aria-expanded
// 2026-10-20: Overview passes homeMenu since 170a5c2 (docs/sw/sw-header-usage.md "Overview의 로고도 같은 홈 메뉴"),
// so this uses the first Logo Slot header (figmaArgs + callbacks, no homeMenu; onHomeClick logs "[SWHeader] home").
await page.setViewportSize({ width: 1920, height: 1000 })
const infos = []
page.on('console', m => { if (m.type() === 'info') infos.push(m.text()) })
await page.goto(`${base}/iframe.html?id=sw-header--overview&viewMode=story`)
await page.goto(`${base}/iframe.html?id=sw-header--logo-slot&viewMode=story`)
await page.locator('.hm-sw-header').first().waitFor()
await home().click()
await page.waitForTimeout(50)
check('without homeMenu: logo click calls onHomeClick, renders no menu, no aria-expanded', infos.some(text => text.includes('onHomeClick')) && await page.locator('.hm-sw-home-menu').count() === 0 && await home().getAttribute('aria-expanded') === null, infos)
check('without homeMenu: logo click calls onHomeClick, renders no menu, no aria-expanded', infos.some(text => text.includes('[SWHeader] home')) && await page.locator('.hm-sw-home-menu').count() === 0 && await home().getAttribute('aria-expanded') === null, infos)
check('no page / console errors', report.errors.length === 0, report.errors)
await writeFile(path.join(out, 'result.json'), JSON.stringify(report, null, 2))