From b172f46f0d0413dcaedc8c901d79e3932cb26589 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Thu, 5 Mar 2026 18:12:08 -0800 Subject: [PATCH] Add E2E tests for Text boxShadow and textWithLinkRole (#55961) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/55961 Add E2E tests for 2 uncovered Text examples in RNTester: - boxShadow: screenshot test using existing testID 'text-box-shadow' - textWithLinkRole: interaction test that screenshots before and after pressing the link (which changes its color from teal to red) Source changes: - Added testID="text-with-link-role" to root View in TextWithLinkRoleExample - Added testID="text-link-role-link" to the first link Text element - Added useState to toggle link color on press (teal -> red) Reviewed By: cortinico Differential Revision: D95359182 fbshipit-source-id: c823b1c0c071aed0750b3cf3f2d7d6b88da87573 --- .../rn-tester/js/examples/Text/TextSharedExamples.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/rn-tester/js/examples/Text/TextSharedExamples.js b/packages/rn-tester/js/examples/Text/TextSharedExamples.js index 5536c744956..3be718720a4 100644 --- a/packages/rn-tester/js/examples/Text/TextSharedExamples.js +++ b/packages/rn-tester/js/examples/Text/TextSharedExamples.js @@ -194,11 +194,17 @@ component RtlAndInlineViewsExample() { } component TextWithLinkRoleExample() { - const handlePress = () => console.log('Link Press'); + const [pressed, setPressed] = useState(false); + const handlePress = () => setPressed(true); + const linkColor = pressed ? 'red' : 'teal'; return ( - - + + Link Text