1212import '@react-native/fantom/src/setUpDefaultReactNativeEnvironment' ;
1313
1414import type { Role } from '../../Components/View/ViewAccessibility' ;
15- import type { HostInstance } from 'react-native' ;
15+ import type { AccessibilityProps , HostInstance } from 'react-native' ;
1616
1717import ensureInstance from '../../../src/private/__tests__/utilities/ensureInstance' ;
1818import * as Fantom from '@react-native/fantom' ;
1919import * as React from 'react' ;
2020import { createRef } from 'react' ;
2121import { Text } from 'react-native' ;
22+ import accessibilityPropsSuite from 'react-native/src/private/__tests__/utilities/accessibilityPropsSuite' ;
2223import ReactNativeElement from 'react-native/src/private/webapis/dom/nodes/ReactNativeElement' ;
2324import ReadOnlyText from 'react-native/src/private/webapis/dom/nodes/ReadOnlyText' ;
2425
@@ -423,38 +424,38 @@ describe('<Text>', () => {
423424
424425 Fantom . runTask ( ( ) => {
425426 root . render (
426- < Text style = { { writingDirection : 'rtl' } } > dummy text </ Text > ,
427+ < Text style = { { writingDirection : 'rtl' } } > { TEST_TEXT } </ Text > ,
427428 ) ;
428429 } ) ;
429430
430431 expect (
431432 root . getRenderedOutput ( { props : [ 'writingDirection' ] } ) . toJSX ( ) ,
432433 ) . toEqual (
433- < rn-paragraph writingDirection = "rtl" > dummy text </ rn-paragraph > ,
434+ < rn-paragraph writingDirection = "rtl" > { TEST_TEXT } </ rn-paragraph > ,
434435 ) ;
435436
436437 Fantom . runTask ( ( ) => {
437438 root . render (
438- < Text style = { { writingDirection : 'ltr' } } > dummy text </ Text > ,
439+ < Text style = { { writingDirection : 'ltr' } } > { TEST_TEXT } </ Text > ,
439440 ) ;
440441 } ) ;
441442
442443 expect (
443444 root . getRenderedOutput ( { props : [ 'writingDirection' ] } ) . toJSX ( ) ,
444445 ) . toEqual (
445- < rn-paragraph writingDirection = "ltr" > dummy text </ rn-paragraph > ,
446+ < rn-paragraph writingDirection = "ltr" > { TEST_TEXT } </ rn-paragraph > ,
446447 ) ;
447448
448449 Fantom . runTask ( ( ) => {
449450 root . render (
450- < Text style = { { writingDirection : 'auto' } } > dummy text </ Text > ,
451+ < Text style = { { writingDirection : 'auto' } } > { TEST_TEXT } </ Text > ,
451452 ) ;
452453 } ) ;
453454
454455 expect (
455456 root . getRenderedOutput ( { props : [ 'writingDirection' ] } ) . toJSX ( ) ,
456457 ) . toEqual (
457- < rn-paragraph writingDirection = "auto" > dummy text </ rn-paragraph > ,
458+ < rn-paragraph writingDirection = "auto" > { TEST_TEXT } </ rn-paragraph > ,
458459 ) ;
459460 } ) ;
460461 } ) ;
@@ -468,7 +469,7 @@ describe('<Text>', () => {
468469 const root = Fantom . createRoot ( ) ;
469470
470471 Fantom . runTask ( ( ) => {
471- root . render ( < Text ref = { elementRef } > Some text </ Text > ) ;
472+ root . render ( < Text ref = { elementRef } > { TEST_TEXT } </ Text > ) ;
472473 } ) ;
473474
474475 const element = ensureInstance ( elementRef . current , ReactNativeElement ) ;
@@ -481,14 +482,14 @@ describe('<Text>', () => {
481482 const root = Fantom . createRoot ( ) ;
482483
483484 Fantom . runTask ( ( ) => {
484- root . render ( < Text ref = { elementRef } > Some text </ Text > ) ;
485+ root . render ( < Text ref = { elementRef } > { TEST_TEXT } </ Text > ) ;
485486 } ) ;
486487
487488 const element = ensureInstance ( elementRef . current , ReactNativeElement ) ;
488489 expect ( element . childNodes . length ) . toBe ( 1 ) ;
489490
490491 const textChild = ensureInstance ( element . childNodes [ 0 ] , ReadOnlyText ) ;
491- expect ( textChild . textContent ) . toBe ( 'Some text' ) ;
492+ expect ( textChild . textContent ) . toBe ( TEST_TEXT ) ;
492493 } ) ;
493494
494495 it ( 'has text and element child nodes when nested' , ( ) => {
@@ -524,4 +525,9 @@ describe('<Text>', () => {
524525 expect ( secondChildText . textContent ) . toBe ( 'also in bold' ) ;
525526 } ) ;
526527 } ) ;
528+
529+ component ComponentWithAccessibilityProps ( ...props : AccessibilityProps ) {
530+ return < Text { ...props } > { TEST_TEXT } </ Text > ;
531+ }
532+ accessibilityPropsSuite ( ComponentWithAccessibilityProps , false ) ;
527533} ) ;
0 commit comments