@@ -223,7 +223,7 @@ describe("editor stylesheet", () => {
223223
224224 expect ( headingToolbarRuleStart ) . toBeGreaterThanOrEqual ( 0 ) ;
225225 expect ( headingToolbarRule ) . toContain ( "position: absolute !important" ) ;
226- expect ( headingToolbarRule ) . toContain ( "left: -78px " ) ;
226+ expect ( headingToolbarRule ) . toContain ( "left: -104px " ) ;
227227 expect ( headingToolbarRule ) . toContain ( "margin: 0 !important" ) ;
228228 expect ( headingToolbarRule ) . toContain (
229229 "top: calc(50% + var(--markra-heading-toggle-center-offset))" ,
@@ -411,22 +411,35 @@ describe("editor stylesheet", () => {
411411 expect ( styles ) . toContain ( "list-style-type: square;" ) ;
412412 } ) ;
413413
414- it ( "shows a quiet inline level list control for the active rendered heading " , ( ) => {
414+ it ( "keeps the active heading- level control out of the editable text layout " , ( ) => {
415415 const styles = readFileSync ( `${ process . cwd ( ) } /src/styles.css` , "utf8" ) ;
416416 const labelStart = styles . indexOf ( ".markdown-paper .markra-heading-level-control {" ) ;
417417 const labelEnd = styles . indexOf ( ".markdown-paper .markra-heading-toggle-heading" ) ;
418418 const labelStyles = styles . slice ( labelStart , labelEnd ) ;
419+ const foldButtonStart = styles . indexOf (
420+ ".markdown-paper .markra-heading-toggle-button {" ,
421+ ) ;
422+ const foldButtonEnd = styles . indexOf (
423+ ".markdown-paper .markra-heading-toggle-heading:hover" ,
424+ foldButtonStart ,
425+ ) ;
426+ const foldButtonStyles = styles . slice ( foldButtonStart , foldButtonEnd ) ;
419427
420428 expect ( labelStart ) . toBeGreaterThanOrEqual ( 0 ) ;
421429 expect ( labelEnd ) . toBeGreaterThan ( labelStart ) ;
422- expect ( labelStyles ) . toContain ( "position: relative " ) ;
430+ expect ( labelStyles ) . toContain ( "position: absolute " ) ;
423431 expect ( labelStyles ) . toContain ( "display: inline-grid" ) ;
424- expect ( labelStyles ) . toContain ( "margin-right" ) ;
432+ expect ( labelStyles ) . toContain ( "left: -28px" ) ;
433+ expect ( labelStyles ) . toContain ( "margin: 0" ) ;
434+ expect ( labelStyles ) . toContain (
435+ "top: calc(50% + var(--markra-heading-toggle-center-offset))" ,
436+ ) ;
437+ expect ( labelStyles ) . toContain ( "transform: translateY(-50%)" ) ;
425438 expect ( labelStyles ) . toContain ( ".markdown-paper .markra-heading-level-list" ) ;
426439 expect ( labelStyles ) . toContain ( "[role=\"option\"]" ) ;
427440 expect ( labelStyles ) . toContain ( ".markdown-paper .markra-heading-level-button::before" ) ;
428- expect ( labelStyles ) . not . toContain ( "left:" ) ;
429441 expect ( labelStyles ) . toContain ( "color: color-mix" ) ;
442+ expect ( foldButtonStyles ) . toContain ( "left: -54px" ) ;
430443 } ) ;
431444
432445 it ( "keeps table add controls hidden until table hover or focus" , ( ) => {
0 commit comments