From cc9b2834db5def2482a416533cccba1b9e3468a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EC=88=98=ED=98=84?= Date: Mon, 19 Oct 2026 23:00:22 +0900 Subject: [PATCH] test(sw): count only the visible home menu row in the Figma geometry check The measured More adds a hidden measure row and a More section, so the geometry check counted 11 sections / 31 tiles / 45 icons instead of 5 / 15 / 30. --- packages/sw/tests/home-menu-integration.browser.mjs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/sw/tests/home-menu-integration.browser.mjs b/packages/sw/tests/home-menu-integration.browser.mjs index 68bfe3c..09a5c97 100644 --- a/packages/sw/tests/home-menu-integration.browser.mjs +++ b/packages/sw/tests/home-menu-integration.browser.mjs @@ -45,14 +45,16 @@ const geometry = await page.evaluate(() => { const header = document.querySelector('.hm-sw-header').getBoundingClientRect() const m = document.querySelector('.hm-sw-home-menu').getBoundingClientRect() const r = e => e.getBoundingClientRect() - const tiles = [...document.querySelectorAll('.hm-sw-home-menu__item')].map(r) + // 2026-10-19: only the visible row; the hidden measure row and the More section also render sections / tiles. + const row = [...document.querySelectorAll('.hm-sw-home-menu__sections > .hm-sw-home-menu__section:not(.hm-sw-home-menu__more)')] + const tiles = row.flatMap(s => [...s.querySelectorAll('.hm-sw-home-menu__item')]).map(r) const badge = getComputedStyle(document.querySelector('.hm-sw-home-menu')).getPropertyValue('--hm-sw-home-menu-title-art') - const icons = [...document.querySelectorAll('.hm-sw-home-menu__icon img')] + const icons = row.flatMap(s => [...s.querySelectorAll('.hm-sw-home-menu__icon img')]) return { left: m.left - header.left, width: m.width, height: m.height, headerHeight: header.height, - sections: [...document.querySelectorAll('.hm-sw-home-menu__section')].map(e => Math.round(r(e).width)), + sections: row.map(e => Math.round(r(e).width)), tiles: tiles.length, tileSizes: [...new Set(tiles.map(t => `${Math.round(t.width)}x${Math.round(t.height)}`))], - titles: document.querySelectorAll('.hm-sw-home-menu__title').length, + titles: row.filter(s => s.querySelector('.hm-sw-home-menu__title')).length, badgeInlined: badge.includes('data:image/svg+xml') || badge.includes('.svg'), icons: icons.length, iconsLoaded: icons.filter(i => i.complete && i.naturalWidth > 0).length, }