Skip to content

Commit 3f90b9b

Browse files
faciledictuclaude
andcommitted
test(Touchable): run rolePropSuite only where Fantom can see role
The debug props of a view do not include role, so Fantom cannot see it on the host view of TouchableOpacity and TouchableHighlight. Keep the suite for TouchableNativeFeedback and TouchableWithoutFeedback, which pass role to their Text child. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MzPpDcGNgvkkyMFtCXhLDi
1 parent 6438a8b commit 3f90b9b

2 files changed

Lines changed: 1 addition & 16 deletions

File tree

‎packages/react-native/Libraries/Components/Touchable/__tests__/TouchableHighlight-itest.js‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@ import '@react-native/fantom/src/setUpDefaultReactNativeEnvironment';
1414
import type {HostInstance} from 'react-native';
1515
import type {AccessibilityProps} from 'react-native';
1616

17-
import accessibilityPropsSuite, {
18-
rolePropSuite,
19-
} from '../../../../src/private/__tests__/utilities/accessibilityPropsSuite';
17+
import accessibilityPropsSuite from '../../../../src/private/__tests__/utilities/accessibilityPropsSuite';
2018
import * as Fantom from '@react-native/fantom';
2119
import nullthrows from 'nullthrows';
2220
import * as React from 'react';
@@ -52,7 +50,6 @@ describe('<TouchableHighlight>', () => {
5250
}
5351

5452
accessibilityPropsSuite(ComponentWithAccessibilityProps);
55-
rolePropSuite(ComponentWithAccessibilityProps);
5653

5754
describe('aria state props', () => {
5855
it('maps aria-checked to accessibilityState', () => {

‎packages/react-native/Libraries/Components/Touchable/__tests__/TouchableOpacity-itest.js‎

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@
1212
import '@react-native/fantom/src/setUpDefaultReactNativeEnvironment';
1313

1414
import type {HostInstance} from 'react-native';
15-
import type {AccessibilityProps} from 'react-native';
1615

17-
import {rolePropSuite} from '../../../../src/private/__tests__/utilities/accessibilityPropsSuite';
1816
import * as Fantom from '@react-native/fantom';
1917
import nullthrows from 'nullthrows';
2018
import * as React from 'react';
@@ -27,16 +25,6 @@ describe('<TouchableOpacity>', () => {
2725
});
2826

2927
describe('props', () => {
30-
component ComponentWithAccessibilityProps(...props: AccessibilityProps) {
31-
return (
32-
<TouchableOpacity {...props}>
33-
<Text>Touchable</Text>
34-
</TouchableOpacity>
35-
);
36-
}
37-
38-
rolePropSuite(ComponentWithAccessibilityProps);
39-
4028
describe('rendering', () => {
4129
it('renders as a view with accessible="true"', () => {
4230
const root = Fantom.createRoot();

0 commit comments

Comments
 (0)