Feat/selector rta#85
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This pull request significantly enhances TWD's documentation and usage examples to highlight full support for Testing Library queries (
screenDom) and user interactions (userEvent). It introduces a new dedicated documentation page for Testing Library support, updates code samples to demonstrate both TWD native selectors and Testing Library queries, and documents the newtwd.should()function for assertions on any element. These improvements make it much easier for users to write accessible, semantic tests using familiar Testing Library patterns alongside TWD's own APIs.Testing Library Integration and Documentation:
docs/api/react-testing-library.md) covering how to use Testing Library queries (screenDom) and user events (userEvent) with TWD, including best practices, examples, and guidance on when to use each approach.screenDomanduserEventas first-class features. [1] [2] [3]Code Examples and Usage Updates:
Assertion Improvements:
twd.should()function, which allows assertions on any DOM element—including those returned by Testing Library queries or raw DOM APIs—making the assertion API more flexible and consistent. [1] [2]These changes greatly improve TWD's accessibility, testing ergonomics, and documentation for users familiar with Testing Library and modern testing best practices.
Fixes #83
Type of Change
Please delete options that are not relevant:
Testing
Test Details
Describe the tests you've added or updated:
Documentation
Note: If your change affects the public API or adds new features, documentation updates are required.
Documentation Changes
List any documentation files you've updated: