@@ -11,6 +11,15 @@ const rawMonitoringFontSizePattern =
1111const rawMonitoringRadiusPattern =
1212 / b o r d e r - r a d i u s : \s * (?: \d + p x | 9 9 9 p x | 9 9 9 9 p x | \d + % | c a l c \( [ ^ ) ] * \d + p x [ ^ ) ] * \) ) / ;
1313
14+ function escapeRegExp ( value : string ) {
15+ return value . replace ( / [ . * + ? ^ $ { } ( ) | [ \] \\ ] / g, "\\$&" ) ;
16+ }
17+
18+ function getRuleBlock ( selector : string ) {
19+ const pattern = new RegExp ( `${ escapeRegExp ( selector ) } \\s*\\{([^}]*)\\}` ) ;
20+ return componentsStyles . match ( pattern ) ?. [ 1 ] ?? "" ;
21+ }
22+
1423function getMonitoringOffenderBlocks ( pattern : RegExp ) {
1524 return Array . from ( componentsStyles . matchAll ( / ( [ ^ { } ] + ) \{ ( [ ^ } ] * ) \} / g) )
1625 . map ( ( match ) => ( {
@@ -36,4 +45,19 @@ describe("monitoring style guardrails", () => {
3645 expect ( componentsStyles ) . toMatch ( rawMonitoringRadiusPattern ) ;
3746 expect ( getMonitoringOffenderBlocks ( rawMonitoringRadiusPattern ) ) . toEqual ( [ ] ) ;
3847 } ) ;
48+
49+ it ( "lets the dense settings monitoring surface grow with dashboard content" , ( ) => {
50+ const denseFillHeightRule = getRuleBlock (
51+ ".settings-content--fill-height > .settings-content-surface--monitoring-dense"
52+ ) ;
53+
54+ expect ( denseFillHeightRule ) . toContain ( "flex: 0 0 auto" ) ;
55+ expect ( denseFillHeightRule ) . toContain ( "min-height: 100%" ) ;
56+ } ) ;
57+
58+ it ( "keeps monitoring data panels padded away from their borders" , ( ) => {
59+ const panelRule = getRuleBlock ( ".monitoring-tree,\n.monitoring-detail" ) ;
60+
61+ expect ( panelRule ) . toContain ( "padding: var(--sp-3)" ) ;
62+ } ) ;
3963} ) ;
0 commit comments