@@ -29,9 +29,10 @@ const clickFontSizeButtonByLabel = async ( label ) => {
2929} ;
3030
3131// Clicks the button to toggle between custom size input and the control for the presets.
32- const toggleCustomInput = async ( ) => {
32+ const toggleCustomInput = async ( showCustomInput ) => {
33+ const label = showCustomInput ? 'Set custom size' : 'Use size preset' ;
3334 const toggleButton = await page . waitForXPath (
34- " //button[@aria-label='Toggle custom size display']"
35+ ` //button[@aria-label='${ label } ']`
3536 ) ;
3637 return toggleButton . click ( ) ;
3738} ;
@@ -68,7 +69,7 @@ describe( 'Font Size Picker', () => {
6869 await clickBlockAppender ( ) ;
6970 await page . keyboard . type ( 'Paragraph to be made "small"' ) ;
7071
71- await toggleCustomInput ( ) ;
72+ await toggleCustomInput ( true ) ;
7273 await clickCustomInput ( ) ;
7374 // This should be the "small" font-size of the editor defaults.
7475 await page . keyboard . type ( '13' ) ;
@@ -84,7 +85,7 @@ describe( 'Font Size Picker', () => {
8485 await clickBlockAppender ( ) ;
8586 await page . keyboard . type ( 'Paragraph to be made "small"' ) ;
8687
87- await toggleCustomInput ( ) ;
88+ await toggleCustomInput ( true ) ;
8889 await clickCustomInput ( ) ;
8990 await page . keyboard . type ( '23' ) ;
9091 expect ( await getEditedPostContent ( ) ) . toMatchInlineSnapshot ( `
@@ -102,7 +103,7 @@ describe( 'Font Size Picker', () => {
102103 ) ;
103104
104105 await clickFontSizeButtonByLabel ( 'Small' ) ;
105- await toggleCustomInput ( ) ;
106+ await toggleCustomInput ( true ) ;
106107
107108 await page . keyboard . press ( 'Tab' ) ;
108109 await page . keyboard . press ( 'Tab' ) ;
@@ -124,7 +125,7 @@ describe( 'Font Size Picker', () => {
124125 ) ;
125126
126127 await clickFontSizeButtonByLabel ( 'Small' ) ;
127- await toggleCustomInput ( ) ;
128+ await toggleCustomInput ( true ) ;
128129 await clickCustomInput ( ) ;
129130 await pressKeyWithModifier ( 'primary' , 'A' ) ;
130131 await page . keyboard . press ( 'Backspace' ) ;
@@ -145,7 +146,7 @@ describe( 'Font Size Picker', () => {
145146 await clickBlockAppender ( ) ;
146147 await page . keyboard . type ( 'Paragraph to be made "small"' ) ;
147148
148- await toggleCustomInput ( ) ;
149+ await toggleCustomInput ( true ) ;
149150 await clickCustomInput ( ) ;
150151 await page . keyboard . type ( '23' ) ;
151152 await page . keyboard . press ( 'Backspace' ) ;
0 commit comments