Skip to content

Commit c7ea834

Browse files
author
Erik Rasmussen
committed
Add assertions for render spy calls per CodeRabbit feedback
1 parent 37f517a commit c7ea834

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/useField.dynamic-name-869.test.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,14 @@ describe('useField - Dynamic Name (Issue #869)', () => {
4747
// Verify all renders have name and value in sync
4848
const calls = renderSpy.mock.calls
4949

50+
// Ensure Field actually rendered
51+
expect(calls.length).toBeGreaterThan(0)
52+
5053
// All calls should have matching name/value pairs
5154
calls.forEach(call => {
5255
const [name, value] = call
56+
// Field name should only be 'a' or 'b'
57+
expect(name).toMatch(/^(a|b)$/)
5358
if (name === 'a') {
5459
expect(value).toBe('value-a')
5560
} else if (name === 'b') {

0 commit comments

Comments
 (0)