Skip to content

Commit

Permalink
馃敡 fix controller test is dirty (#10899)
Browse files Browse the repository at this point in the history
  • Loading branch information
pierluigigiancola committed Sep 8, 2023
1 parent ece261a commit 28a45bd
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/__tests__/controller.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,7 @@ describe('Controller', () => {
render={({ field: props, fieldState }) => (
<>
<input {...props} />
{fieldState.isTouched && <p>Input is dirty.</p>}
{fieldState.isDirty && <p>Input is dirty.</p>}
</>
)}
control={control}
Expand All @@ -736,8 +736,7 @@ describe('Controller', () => {

const input = screen.getByRole('textbox');

fireEvent.focus(input);
fireEvent.blur(input);
fireEvent.change(input, { target: { value: 'dirty' } });

expect(await screen.findByText('Input is dirty.')).toBeVisible();
});
Expand Down

0 comments on commit 28a45bd

Please sign in to comment.