Skip to content

Comments

test(utils): add unit tests for live function with Ref type#12932

Merged
bluebill1049 merged 1 commit intoreact-hook-form:masterfrom
kamja44:test/add-live-util-unit-test
Jul 4, 2025
Merged

test(utils): add unit tests for live function with Ref type#12932
bluebill1049 merged 1 commit intoreact-hook-form:masterfrom
kamja44:test/add-live-util-unit-test

Conversation

@kamja44
Copy link
Contributor

@kamja44 kamja44 commented Jul 4, 2025

This PR adds unit tests for the live utility function to verify its behavior under different scenarios:

Returns true when the ref is an HTMLElement and is connected to the DOM.

Returns false when the ref is not connected.

Returns false when the ref is not an HTMLElement.

These tests use a mocked version of isHTMLElement to isolate the function logic.
The goal is to ensure the correctness and reliability of the live function used internally in the library.

Copy link
Member

@bluebill1049 bluebill1049 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bluebill1049 bluebill1049 merged commit 898e196 into react-hook-form:master Jul 4, 2025
6 checks passed
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.

2 participants