@@ -66,7 +66,7 @@ describe('notification', () => {
6666 notification . destroy ( ) ;
6767 } ) ;
6868
69- it ( 'should be able to open with icon' , done => {
69+ it ( 'should be able to open with icon' , async ( ) => {
7070 const openNotificationWithIcon = async type => {
7171 const iconPrefix = '.ant-notification-notice-icon' ;
7272 notification [ type ] ( {
@@ -78,10 +78,10 @@ describe('notification', () => {
7878 expect ( document . querySelectorAll ( `${ iconPrefix } -${ type } ` ) . length ) . toBe ( 1 ) ;
7979 } , 0 ) ;
8080 } ;
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' ) ;
8585 } ) ;
8686
8787 it ( 'trigger onClick' , ( ) => {
@@ -97,27 +97,27 @@ describe('notification', () => {
9797 notification . open ( {
9898 message : 'Notification Title' ,
9999 duration : 0 ,
100- closeIcon : h => < StepBackwardOutlined /> ,
100+ closeIcon : < StepBackwardOutlined /> ,
101101 } ) ;
102102 } ) ;
103103 await asyncExpect ( ( ) => {
104104 expect ( document . querySelectorAll ( '.anticon-step-backward' ) . length ) . toBe ( 1 ) ;
105- } ) ;
105+ } , 100 ) ;
106106 } ) ;
107107
108108 it ( 'support config closeIcon' , async ( ) => {
109109 notification . config ( {
110- closeIcon : h => < StepBackwardOutlined /> ,
110+ closeIcon : < StepBackwardOutlined /> ,
111111 } ) ;
112112 await asyncExpect ( ( ) => {
113113 notification . open ( {
114114 message : 'Notification Title' ,
115115 duration : 0 ,
116- closeIcon : h => < StepBackwardOutlined /> ,
116+ closeIcon : < StepBackwardOutlined /> ,
117117 } ) ;
118118 } ) ;
119119 await asyncExpect ( ( ) => {
120120 expect ( document . querySelectorAll ( '.anticon-step-backward' ) . length ) . toBe ( 1 ) ;
121- } ) ;
121+ } , 100 ) ;
122122 } ) ;
123123} ) ;
0 commit comments