@@ -66,7 +66,7 @@ describe('notification', () => {
66
66
notification . destroy ( ) ;
67
67
} ) ;
68
68
69
- it ( 'should be able to open with icon' , done => {
69
+ it ( 'should be able to open with icon' , async ( ) => {
70
70
const openNotificationWithIcon = async type => {
71
71
const iconPrefix = '.ant-notification-notice-icon' ;
72
72
notification [ type ] ( {
@@ -78,10 +78,10 @@ describe('notification', () => {
78
78
expect ( document . querySelectorAll ( `${ iconPrefix } -${ type } ` ) . length ) . toBe ( 1 ) ;
79
79
} , 0 ) ;
80
80
} ;
81
- [ 'success' , 'info' , 'warning' , 'error' ] . forEach ( type => {
82
- openNotificationWithIcon ( type ) ;
83
- } ) ;
84
- done ( ) ;
81
+ await openNotificationWithIcon ( 'success' ) ;
82
+ await openNotificationWithIcon ( 'info' ) ;
83
+ await openNotificationWithIcon ( 'warning' ) ;
84
+ await openNotificationWithIcon ( 'error' ) ;
85
85
} ) ;
86
86
87
87
it ( 'trigger onClick' , ( ) => {
@@ -97,27 +97,27 @@ describe('notification', () => {
97
97
notification . open ( {
98
98
message : 'Notification Title' ,
99
99
duration : 0 ,
100
- closeIcon : h => < StepBackwardOutlined /> ,
100
+ closeIcon : < StepBackwardOutlined /> ,
101
101
} ) ;
102
102
} ) ;
103
103
await asyncExpect ( ( ) => {
104
104
expect ( document . querySelectorAll ( '.anticon-step-backward' ) . length ) . toBe ( 1 ) ;
105
- } ) ;
105
+ } , 100 ) ;
106
106
} ) ;
107
107
108
108
it ( 'support config closeIcon' , async ( ) => {
109
109
notification . config ( {
110
- closeIcon : h => < StepBackwardOutlined /> ,
110
+ closeIcon : < StepBackwardOutlined /> ,
111
111
} ) ;
112
112
await asyncExpect ( ( ) => {
113
113
notification . open ( {
114
114
message : 'Notification Title' ,
115
115
duration : 0 ,
116
- closeIcon : h => < StepBackwardOutlined /> ,
116
+ closeIcon : < StepBackwardOutlined /> ,
117
117
} ) ;
118
118
} ) ;
119
119
await asyncExpect ( ( ) => {
120
120
expect ( document . querySelectorAll ( '.anticon-step-backward' ) . length ) . toBe ( 1 ) ;
121
- } ) ;
121
+ } , 100 ) ;
122
122
} ) ;
123
123
} ) ;
0 commit comments