Skip to content

Commit 6bc2f51

Browse files
authored
feat: add FAQ for svelte-testing-library (#1268)
1 parent 93b5612 commit 6bc2f51

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

docs/svelte-testing-library/faq.mdx

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
id: faq
3+
title: FAQ
4+
sidebar_label: FAQ
5+
---
6+
7+
- [Testing file upload component](#testing-file-upload-component)
8+
9+
---
10+
11+
## Testing file upload component
12+
13+
File upload handler not triggering? Use `happy-dom`, not `jsdom`, and make
14+
sure to use `fireEvent.change(...)` and not `fireEvent.input(...)`. It seems
15+
that jsdom (which is at v22.1.0 at the time of this writing) doesn't fake all
16+
the File object as it should.
17+
18+
19+
See [svelte-testing-library's issue
20+
219](https://github.com/testing-library/svelte-testing-library/issues/219) for
21+
more details.
22+

sidebars.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ module.exports = {
161161
'svelte-testing-library/setup',
162162
'svelte-testing-library/example',
163163
'svelte-testing-library/api',
164+
'svelte-testing-library/faq',
164165
],
165166
},
166167
'cypress-testing-library/intro',

0 commit comments

Comments
 (0)