react-native-windows icon indicating copy to clipboard operation
react-native-windows copied to clipboard

Add Functional Tests for TouchableWithoutFeedback Component

Open Copilot opened this issue 7 months ago • 4 comments

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:

Copilot avatar Jun 11 '25 09:06 Copilot

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

anupriya13 avatar Jun 11 '25 09:06 anupriya13

@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 avatar Jun 11 '25 09:06 Copilot

/azp run

anupriya13 avatar Jun 11 '25 09:06 anupriya13

Azure Pipelines successfully started running 2 pipeline(s).

azure-pipelines[bot] avatar Jun 11 '25 09:06 azure-pipelines[bot]