Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions docs/svelte-testing-library/faq.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
id: faq
title: FAQ
sidebar_label: FAQ
---

- [Testing file upload component](#testing-file-upload-component)

---

## Testing file upload component

File upload handler not triggering? Use `happy-dom`, not `jsdom`, and make
sure to use `fireEvent.change(...)` and not `fireEvent.input(...)`. It seems
that jsdom (which is at v22.1.0 at the time of this writing) doesn't fake all
the File object as it should.


See [svelte-testing-library's issue
219](https://github.com/testing-library/svelte-testing-library/issues/219) for
more details.

1 change: 1 addition & 0 deletions sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ module.exports = {
'svelte-testing-library/setup',
'svelte-testing-library/example',
'svelte-testing-library/api',
'svelte-testing-library/faq',
],
},
'cypress-testing-library/intro',
Expand Down