@@ -165,6 +165,34 @@ test.describe('design baseline', () => {
165165 expect ( navbarRule , 'scrolled navbar should keep backdrop blur CSS rule' ) . toContain ( 'blur' ) ;
166166 } ) ;
167167
168+ test ( 'team photos keep square framing' , async ( { page } ) => {
169+ await page . goto ( '/' ) ;
170+ await lockViewportOn ( page , '#team' ) ;
171+ await waitForVisualReady ( page ) ;
172+
173+ const frames = await page . locator ( '.team__photo' ) . evaluateAll ( ( elements ) =>
174+ elements . map ( ( element ) => {
175+ const frame = element . getBoundingClientRect ( ) ;
176+ const image = element . querySelector ( 'img' ) ?. getBoundingClientRect ( ) ;
177+
178+ return {
179+ frameWidth : frame . width ,
180+ frameHeight : frame . height ,
181+ imageWidth : image ?. width ?? 0 ,
182+ imageHeight : image ?. height ?? 0 ,
183+ } ;
184+ } ) ,
185+ ) ;
186+
187+ expect ( frames ) . toHaveLength ( 3 ) ;
188+
189+ for ( const frame of frames ) {
190+ expect ( Math . abs ( frame . frameWidth - frame . frameHeight ) , 'team photo frame should stay square' ) . toBeLessThan ( 2 ) ;
191+ expect ( Math . abs ( frame . imageWidth - frame . frameWidth ) , 'team image should fill frame width' ) . toBeLessThan ( 2 ) ;
192+ expect ( Math . abs ( frame . imageHeight - frame . frameHeight ) , 'team image should fill frame height' ) . toBeLessThan ( 2 ) ;
193+ }
194+ } ) ;
195+
168196 for ( const state of states ) {
169197 test ( `${ state . name } viewport matches approved baseline` , async ( { page } , testInfo ) => {
170198 await state . target ( page ) ;
0 commit comments