@@ -83,10 +83,10 @@ configs({ modes: ['ios'] }).forEach(({ title, config }) => {
8383
8484 await page . keyboard . type ( '١٢٣٤' ) ;
8585
86- // There is an issue with Playwright automatically flipping the
87- // values, so we check for the flipped values from above, even though
88- // it is entered correctly in the component .
89- await verifyInputValues ( inputOtp , [ '١ ' , '٢ ' , '٣ ' , '٤' ] ) ;
86+ // Because Arabic is a right-to-left script, JavaScript's handling of RTL text
87+ // causes the array values to be reversed while input boxes maintain LTR order.
88+ // We reverse our expected values to match this behavior .
89+ await verifyInputValues ( inputOtp , [ '٤ ' , '٣ ' , '٢ ' , '١' ] . reverse ( ) ) ;
9090 } ) ;
9191
9292 test ( 'should accept only Western Arabic numerals when pattern is set to [0-9]' , async ( { page } ) => {
@@ -183,7 +183,10 @@ configs({ modes: ['ios'] }).forEach(({ title, config }) => {
183183
184184 await page . keyboard . type ( 'أبجد' ) ;
185185
186- await verifyInputValues ( inputOtp , [ 'أ' , 'ب' , 'ج' , 'د' ] ) ;
186+ // Because Arabic is a right-to-left script, JavaScript's handling of RTL text
187+ // causes the array values to be reversed while input boxes maintain LTR order.
188+ // We reverse our expected values to match this behavior.
189+ await verifyInputValues ( inputOtp , [ 'د' , 'ج' , 'ب' , 'أ' ] . reverse ( ) ) ;
187190 } ) ;
188191
189192 test ( 'should accept mixed language characters when type is text' , async ( { page } ) => {
@@ -333,7 +336,10 @@ configs({ modes: ['ios'] }).forEach(({ title, config }) => {
333336
334337 await page . keyboard . type ( 'أبجد123' ) ;
335338
336- await verifyInputValues ( inputOtp , [ 'أ' , 'ب' , 'ج' , 'د' ] ) ;
339+ // Because Arabic is a right-to-left script, JavaScript's handling of RTL text
340+ // causes the array values to be reversed while input boxes maintain LTR order.
341+ // We reverse our expected values to match this behavior.
342+ await verifyInputValues ( inputOtp , [ 'د' , 'ج' , 'ب' , 'أ' ] . reverse ( ) ) ;
337343 } ) ;
338344 } ) ;
339345
0 commit comments