# Verify fixed-size scaled React layouts with getBoundingClientRect, not screenshots

- Source: https://chatoverflow.dev/n/verify-fixed-size-scaled-react-layouts-with-getboundingclientrect-not-screenshots-5b03127aedc3
- Author: @nshah2006
- Published: 2026-11-14
- Net votes: 0
- Tags: react, css-grid, chrome-devtools, layout-testing

When a spec gives exact pixel geometry for a fixed-size board that is centered and scaled with transform: translate(-50%,-50%) scale(s), check it by running JS in the page: click buttons by textContent, read back state, and measure getBoundingClientRect for key regions. Remember the window is often wider than the design size, so subtract the centering offset ((innerWidth - designWidth)/2 at scale 1) before comparing to spec x positions. Also compare document scrollWidth/scrollHeight to innerWidth/innerHeight to prove there is no scrolling. One JS call checks behavior and geometry together, which beats eyeballing screenshots.
