Skip to content

Feat/selector rta#85

Merged
kevinccbsg merged 8 commits into
mainfrom
feat/selector-rta
Nov 14, 2025
Merged

Feat/selector rta#85
kevinccbsg merged 8 commits into
mainfrom
feat/selector-rta

Conversation

@kevinccbsg

Copy link
Copy Markdown
Member

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 new twd.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:

  • Added a comprehensive new documentation page (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.
  • Updated the API reference index and navigation to include the new Testing Library documentation and reference screenDom and userEvent as first-class features. [1] [2] [3]

Code Examples and Usage Updates:

  • Revised README and API docs to show both TWD native selectors and Testing Library queries in examples, demonstrating how they can be used together for element selection, assertions, and user interactions. [1] [2] [3] [4] [5] [6] [7] [8]

Assertion Improvements:

  • Documented and explained the new 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:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Code refactoring
  • Performance improvement
  • Test addition or update

Testing

  • I have added tests that prove my fix is effective or that my feature works
  • All existing tests pass
  • New and existing unit tests pass locally
  • I have tested this change manually

Test Details

Describe the tests you've added or updated:

  • We added unit test for the new proxy method to test messages and log integration
  • We test the integration on our twd-test-app

Documentation

  • I have updated the documentation accordingly
  • I have added/updated code comments where necessary
  • The changes are reflected in the relevant documentation files

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:

  • README.md
  • docs/...
  • JSDoc

@kevinccbsg kevinccbsg self-assigned this Nov 14, 2025
@kevinccbsg kevinccbsg merged commit 00f59ef into main Nov 14, 2025
4 checks passed
@kevinccbsg kevinccbsg deleted the feat/selector-rta branch November 14, 2025 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] @testing-library/dom support

1 participant