Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven7926 committed Jan 5, 2025
1 parent e537ff4 commit 25e162f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/components/forms/FileInput/FileInput.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -408,9 +408,10 @@ describe('FileInput component', () => {
'display-none'
)

// Notice how input.files still exist because we can't programmatically set the value
expect(fileInputRef.current?.input?.files).toHaveLength(1)
// But the files state of the React "input" is cleared out
// Inputs files should be cleared out and reset
expect(fileInputRef.current?.input?.files).toHaveLength(0)
expect(fileInputRef.current?.input?.value).toEqual('')
// Files state of the React "input" is cleared out
expect(fileInputRef.current?.files).toHaveLength(0)
})
})
Expand Down

0 comments on commit 25e162f

Please sign in to comment.