-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Add Functional Tests for Pressable Component #14770
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
base: main
Are you sure you want to change the base?
Conversation
…ess, hitSlop, and styling configurations Co-authored-by: anupriya13 <54227869+anupriya13@users.noreply.github.com>
…ional test components Co-authored-by: anupriya13 <54227869+anupriya13@users.noreply.github.com>
@copilot run |
Co-authored-by: anupriya13 <54227869+anupriya13@users.noreply.github.com>
I've generated the change file and committed it (a086ec5). The change file has been created following the beachball format to track the new Pressable functional tests. You can now run "/azp run" to start the pipelines. |
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
@copilot fix pipeline issue for change file: ##[error]PowerShell exited with code '1'. |
Co-authored-by: anupriya13 <54227869+anupriya13@users.noreply.github.com>
Fixed the change file to use "prerelease" instead of "patch" change type to align with repository standards (39f2df7). The pipeline validation should now pass. |
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
@copilot RUN 'yarn format' and 'yarn lint:fix' then verify with 'yarn lint' if there are any errors then please fix those. Once you are done comment "/azp run" only on this PR. |
Co-authored-by: anupriya13 <54227869+anupriya13@users.noreply.github.com>
I've successfully applied formatting and linting fixes to the test file: ✅ Formatting: Applied prettier formatting to fix code style issues The changes include:
Note: Full Commit: 66655af /azp run |
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
}, | ||
); | ||
}); | ||
// TODO: Add fast refresh tests once test components are available |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot Please remove the comments from lines 458-462.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the TODO comments from lines 458-462 as requested. Commit: b67b127
@copilot please run |
Co-authored-by: chiaramooney <34109996+chiaramooney@users.noreply.github.com>
I attempted to run |
}, | ||
); | ||
}); | ||
test('Pressable should register onPress action when hit within hitSlop range', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot hitSlop is not supported on fabric. please remove this test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the hitSlop test as requested since hitSlop is not supported on fabric. Commit: b060bba
}, | ||
); | ||
}); | ||
test('Pressable should support different children configurations', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot how is this test testing a behavior not already covered within the other tests of this file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're absolutely right. The test was redundant with the existing "Pressables can change text on press/rest, state rest" test, which already captures both the initial and pressed states of the same component ('one_press_me_button'). I've removed the duplicate test. Commit: 856fe72
Co-authored-by: chiaramooney <34109996+chiaramooney@users.noreply.github.com>
Co-authored-by: chiaramooney <34109996+chiaramooney@users.noreply.github.com>
This PR adds functional tests for the Pressable component to the E2E test app (Fabric) to validate key functionality scenarios as requested in the issue.
Changes Made
New Functional Tests Added:
Pressable should perform action upon onLongPress - Tests that Pressable components can handle long press actions and properly capture events in the feedback events console
Pressable behavior should change upon delayLongPress adjustment - Tests that Pressable components respect delayLongPress timing adjustments (800ms delay) and capture delayed event responses
Pressable should register onPress action when hit within hitSlop range - Tests that Pressable components register clicks within their expanded hit areas and update the press counter
Pressable should support different disabled styling configurations - Tests both disabled=true and disabled=false styling configurations by capturing visual tree snapshots of each state
Pressable should support different children configurations - Tests that Pressable components can display different content based on interaction state (e.g., "Press Me" vs "Pressed!")
Bug Fix:
pressable_hit_slop_button
instead ofadvanced_borders_pressable
)Test Implementation Notes:
PressableExample.windows.js
with their available testIDsRemaining Fast Refresh Tests:
The following 3 tests are documented with TODO comments but require additional test components to be implemented:
These would need components with toggle buttons/switches that can dynamically change border styling, children content, and disabled state at runtime to properly test fast refresh behavior.
Testing
The tests validate Pressable functionality through visual tree snapshots and follow the same patterns as existing component tests in the E2E test suite.
Fixes #12461.
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
/usr/local/bin/node install.mjs
(dns block)https://storage.googleapis.com/chrome-for-testing-public/130.0.6723.116/linux64/chrome-headless-shell-linux64.zip
/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: