1
1
import React from "react" ;
2
- import { cleanup , render , fireEvent } from "@testing-library/react" ;
2
+ import { cleanup , render } from "@testing-library/react" ;
3
3
import "@testing-library/jest-dom/extend-expect" ;
4
4
import userEvent from "../../src" ;
5
5
@@ -86,14 +86,6 @@ describe("userEvent.upload", () => {
86
86
expect ( input . files [ 0 ] ) . toStrictEqual ( file ) ;
87
87
expect ( input . files . item ( 0 ) ) . toStrictEqual ( file ) ;
88
88
expect ( input . files ) . toHaveLength ( 1 ) ;
89
-
90
- fireEvent . change ( input , {
91
- target : { files : { item : ( ) => { } , length : 0 } } ,
92
- } ) ;
93
-
94
- expect ( input . files [ 0 ] ) . toBeUndefined ( ) ;
95
- expect ( input . files . item [ 0 ] ) . toBeUndefined ( ) ;
96
- expect ( input . files ) . toHaveLength ( 0 ) ;
97
89
} ) ;
98
90
99
91
it ( "should upload multiple files" , ( ) => {
@@ -113,14 +105,6 @@ describe("userEvent.upload", () => {
113
105
expect ( input . files [ 1 ] ) . toStrictEqual ( files [ 1 ] ) ;
114
106
expect ( input . files . item ( 1 ) ) . toStrictEqual ( files [ 1 ] ) ;
115
107
expect ( input . files ) . toHaveLength ( 2 ) ;
116
-
117
- fireEvent . change ( input , {
118
- target : { files : { item : ( ) => { } , length : 0 } } ,
119
- } ) ;
120
-
121
- expect ( input . files [ 0 ] ) . toBeUndefined ( ) ;
122
- expect ( input . files . item [ 0 ] ) . toBeUndefined ( ) ;
123
- expect ( input . files ) . toHaveLength ( 0 ) ;
124
108
} ) ;
125
109
126
110
it ( "should not upload when is disabled" , ( ) => {
@@ -134,7 +118,7 @@ describe("userEvent.upload", () => {
134
118
userEvent . upload ( input , file ) ;
135
119
136
120
expect ( input . files [ 0 ] ) . toBeUndefined ( ) ;
137
- expect ( input . files . item [ 0 ] ) . toBeUndefined ( ) ;
121
+ expect ( input . files . item ( 0 ) ) . toBeNull ( ) ;
138
122
expect ( input . files ) . toHaveLength ( 0 ) ;
139
123
} ) ;
140
124
} ) ;
0 commit comments