File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -239,6 +239,28 @@ export const test = (test) => {
239
239
assert . equal ( "blob" , file . name ) ;
240
240
} ) ;
241
241
242
+ // this will only pass when running `npm run test:web` for this package
243
+ test . skip ( "Allows passing a form element" , ( ) => {
244
+ const form = document . createElement ( "form" ) ;
245
+ const insideInput = document . createElement ( "input" ) ;
246
+ const outsideInput = document . createElement ( "input" ) ;
247
+
248
+ outsideInput . innerHTML = `<input type="text" name="form" value="outside" form="my-form">` ;
249
+
250
+ insideInput . type = "text" ;
251
+ insideInput . name = "form" ;
252
+ insideInput . value = "inside" ;
253
+
254
+ form . appendChild ( insideInput ) ;
255
+ form . id = "my-form" ;
256
+
257
+ document . body . appendChild ( form ) ;
258
+ document . body . appendChild ( outsideInput ) ;
259
+
260
+ const formData = new FormData ( form ) ;
261
+ assert . equal ( formData . getAll ( "form" ) , [ "inside" , "outside" ] ) ;
262
+ } )
263
+
242
264
test . skip ( "complicated form" , ( ) => {
243
265
const data = new FormData ( ) ;
244
266
data . append ( "blobs" , new Blob ( [ "basic" ] ) ) ;
You can’t perform that action at this time.
0 commit comments