@@ -20,7 +20,7 @@ describe('Dialog.Portal', () => {
20
20
it ( 'event should bubble' , ( ) => {
21
21
const onClose = jest . fn ( ) ;
22
22
23
- const { container } = render (
23
+ render (
24
24
< Dialog onClose = { onClose } visible >
25
25
< Select virtual = { false } open >
26
26
< Select . Option value = "bamboo" > Bamboo</ Select . Option >
@@ -30,25 +30,25 @@ describe('Dialog.Portal', () => {
30
30
31
31
jest . runAllTimers ( ) ;
32
32
33
- fireEvent . mouseDown ( container . querySelector ( '.rc-dialog-section' ) ) ;
34
- fireEvent . click ( container . querySelector ( '.rc-select-item-option-content' ) ) ;
35
- fireEvent . mouseUp ( container . querySelector ( '.rc-dialog-section' ) ) ;
33
+ fireEvent . mouseDown ( document . querySelector ( '.rc-dialog-section' ) ) ;
34
+ fireEvent . click ( document . querySelector ( '.rc-select-item-option-content' ) ) ;
35
+ fireEvent . mouseUp ( document . querySelector ( '.rc-dialog-section' ) ) ;
36
36
expect ( onClose ) . not . toHaveBeenCalled ( ) ;
37
37
} ) ;
38
38
39
39
it ( 'dialog dont close when mouseDown in content and mouseUp in wrap' , ( ) => {
40
40
const onClose = jest . fn ( ) ;
41
41
42
- const { container } = render (
42
+ render (
43
43
< Dialog onClose = { onClose } visible >
44
44
content
45
45
</ Dialog > ,
46
46
) ;
47
47
48
48
jest . runAllTimers ( ) ;
49
49
50
- fireEvent . mouseDown ( container . querySelector ( '.rc-dialog-section' ) ) ;
51
- fireEvent . mouseUp ( container . querySelector ( '.rc-dialog-wrap' ) ) ;
50
+ fireEvent . mouseDown ( document . querySelector ( '.rc-dialog-section' ) ) ;
51
+ fireEvent . mouseUp ( document . querySelector ( '.rc-dialog-wrap' ) ) ;
52
52
expect ( onClose ) . not . toHaveBeenCalled ( ) ;
53
53
} ) ;
54
54
} ) ;
0 commit comments