@@ -301,14 +301,25 @@ suite.define(() => {
301301 panel . dir = dir ;
302302 const tabBase = node . shadowRoot ?. querySelector < HTMLElement > ( "[part~='base']" ) ;
303303 const leadingGlyph = node . querySelector < HTMLElement > ( ".tabstrip-tab__icon svg" ) ;
304+ const label = node . querySelector < HTMLElement > ( ".tabstrip-tab__label" ) ;
305+ const labelClipper = node . querySelector < HTMLElement > ( ".tabstrip-tab__tooltip-trigger" ) ;
304306 const close = node . nextElementSibling ;
305307 const trailingGlyph = close ?. querySelector < HTMLElement > ( "svg" ) ;
306- if ( ! ( close instanceof HTMLElement ) || ! tabBase || ! leadingGlyph || ! trailingGlyph ) {
307- throw new Error ( "Active side-panel tab must render both edge glyphs" ) ;
308+ if (
309+ ! ( close instanceof HTMLElement ) ||
310+ ! tabBase ||
311+ ! leadingGlyph ||
312+ ! label ||
313+ ! labelClipper ||
314+ ! trailingGlyph
315+ ) {
316+ throw new Error ( "Active side-panel tab must render its label and both edge glyphs" ) ;
308317 }
309318 const tabBounds = tabBase . getBoundingClientRect ( ) ;
310319 const closeBounds = close . getBoundingClientRect ( ) ;
311320 const leadingBounds = leadingGlyph . getBoundingClientRect ( ) ;
321+ const labelBounds = label . getBoundingClientRect ( ) ;
322+ const labelClipperBounds = labelClipper . getBoundingClientRect ( ) ;
312323 const trailingBounds = trailingGlyph . getBoundingClientRect ( ) ;
313324 const rtl = dir === "rtl" ;
314325 const tabStyle = getComputedStyle ( tabBase ) ;
@@ -320,6 +331,8 @@ suite.define(() => {
320331 trailing : rtl
321332 ? trailingBounds . left - closeBounds . left
322333 : closeBounds . right - trailingBounds . right ,
334+ labelBlockStartInset : labelBounds . top - labelClipperBounds . top ,
335+ labelBlockEndInset : labelClipperBounds . bottom - labelBounds . bottom ,
323336 tabOuterRadius : Number . parseFloat (
324337 rtl ? tabStyle . borderTopRightRadius : tabStyle . borderTopLeftRadius ,
325338 ) ,
@@ -335,6 +348,14 @@ suite.define(() => {
335348 } ;
336349 } , direction ) ;
337350 expect ( tabPadding . trailing , `${ direction } glyph insets` ) . toBeCloseTo ( tabPadding . leading , 0 ) ;
351+ expect (
352+ tabPadding . labelBlockStartInset ,
353+ `${ direction } label block-start containment` ,
354+ ) . toBeGreaterThanOrEqual ( 0 ) ;
355+ expect (
356+ tabPadding . labelBlockEndInset ,
357+ `${ direction } label block-end containment` ,
358+ ) . toBeGreaterThanOrEqual ( 0 ) ;
338359 expect ( tabPadding . tabJoinRadius , `${ direction } tab join` ) . toBe ( 0 ) ;
339360 expect ( tabPadding . closeJoinRadius , `${ direction } close join` ) . toBe ( 0 ) ;
340361 expect ( tabPadding . tabOuterRadius , `${ direction } tab outer` ) . toBeGreaterThan ( 0 ) ;
0 commit comments