Skip to content

Add Functional Tests for TouchableWithoutFeedback Component #14766

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Copilot
Copy link

@Copilot Copilot AI commented Jun 11, 2025

This PR adds functional tests for the TouchableWithoutFeedback component to the E2E test app (Fabric) to validate key functionality scenarios.

Changes Made

Added Test Components to TouchableExample.js:

  1. TouchableWithoutFeedbackHitSlop - Tests hit slop functionality

    • Demonstrates that touch area extends beyond visual bounds using the hitSlop property
    • Includes press counter and visual feedback via console log for test validation
  2. TouchableWithoutFeedbackStyleUpdate - Tests dynamic style changes for fast refresh support

    • Cycles through different background colors on press to demonstrate style updates
    • Shows that TouchableWithoutFeedback can update styles dynamically

Added Test Cases to TouchableComponentTest.test.ts:

  1. TouchableWithoutFeedback should register press in clicked within hitSlop range - Validates that the hit slop area properly extends the touch area beyond the component's visual bounds

  2. TouchableWithoutFeedback should update style upon fast refresh - Validates that dynamic style updates work correctly and support fast refresh functionality

Implementation Notes

The following tests from the original issue were determined to be inappropriate for TouchableWithoutFeedback:

  • underlayColor updates - This property belongs to TouchableHighlight
  • activeOpacity updates - This property belongs to TouchableOpacity

TouchableWithoutFeedback is specifically designed to provide no visual feedback, so testing visual feedback properties would be contrary to its intended purpose.

Test Coverage

This implementation completes the remaining functional tests for TouchableWithoutFeedback. The following tests were already implemented:

  • Press event handling (onPress, onPressIn, onPressOut, onLongPress)
  • Disabled state behavior

Fixes #12467.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • googlechromelabs.github.io
    • Triggering command: /usr/local/bin/node install.mjs (dns block)
  • https://storage.googleapis.com/chrome-for-testing-public/130.0.6723.116/linux64/chrome-linux64.zip
    • Triggering command: /usr/local/bin/node install.mjs (http block)

If you need me to access, download, or install something from one of these locations, you can either:

@microsoft-github-policy-service microsoft-github-policy-service bot added Area: Fabric Support Facebook Fabric Area: Tests New Architecture Broad category for issues that apply to the RN "new" architecture of Turbo Modules + Fabric labels Jun 11, 2025
@Copilot Copilot AI changed the title [WIP] Add Functional Tests for TouchableWithoutFeedback Component Add Functional Tests for TouchableWithoutFeedback Component Jun 11, 2025
@Copilot Copilot AI requested a review from anupriya13 June 11, 2025 09:13
Copilot finished work on behalf of anupriya13 June 11, 2025 09:13
@anupriya13
Copy link
Contributor

@copilot run yarn change and then commit.
After commit comment here "/azp run" to start the pipelines

Copy link
Author

Copilot AI commented Jun 11, 2025

@copilot run yarn change and then commit.
After commit comment here "/azp run" to start the pipelines

I ran yarn change which executed successfully. Beachball determined that no change files are needed since the modifications are test-only changes to private packages that don't require version tracking. There are no new changes to commit beyond the existing commits (8800150) that contain the TouchableWithoutFeedback functional tests.

You can now comment "/azp run" to start the pipelines.

Copilot finished work on behalf of anupriya13 June 11, 2025 09:38
@anupriya13
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 2 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Fabric Support Facebook Fabric Area: Tests New Architecture Broad category for issues that apply to the RN "new" architecture of Turbo Modules + Fabric
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Functional Tests for TouchableWithoutFeedback Component
2 participants