@@ -90,7 +90,7 @@ describe('UUIToastNotificationElement', () => {
90
90
element . open = true ;
91
91
await elementUpdated ( element ) ;
92
92
const listener = oneEvent ( element , UUIToastNotificationEvent . CLOSING ) ;
93
- await sleep ( 600 ) ; // enough time for opening-animation to be done.
93
+ await sleep ( animationDuration + 1 ) ; // enough time for opening-animation to be done.
94
94
expect ( element . open ) . to . be . true ;
95
95
element . open = false ;
96
96
const event = await listener ;
@@ -102,7 +102,7 @@ describe('UUIToastNotificationElement', () => {
102
102
element . open = true ;
103
103
await elementUpdated ( element ) ;
104
104
const listener = oneEvent ( element , UUIToastNotificationEvent . CLOSING ) ;
105
- await sleep ( 100 ) ; // enough time for the rendering and opening-animation to start.
105
+ await sleep ( animationDuration / 2 ) ; // enough time for the rendering and opening-animation to start.
106
106
expect ( element . open ) . to . be . true ;
107
107
element . open = false ;
108
108
const event = await listener ;
@@ -117,7 +117,7 @@ describe('UUIToastNotificationElement', () => {
117
117
element . addEventListener ( UUIToastNotificationEvent . CLOSING , e => {
118
118
e . preventDefault ( ) ;
119
119
} ) ;
120
- await sleep ( 100 ) ; // enough time for the rendering and opening-animation to start.
120
+ await sleep ( animationDuration / 2 ) ; // enough time for the rendering and opening-animation to start.
121
121
expect ( element . open ) . to . be . true ;
122
122
element . open = false ;
123
123
const event = await listener ;
@@ -131,7 +131,7 @@ describe('UUIToastNotificationElement', () => {
131
131
element . open = true ;
132
132
await elementUpdated ( element ) ;
133
133
const listener = oneEvent ( element , UUIToastNotificationEvent . CLOSED ) ;
134
- await sleep ( 600 ) ; // enough time for opening-animation to be done.
134
+ await sleep ( animationDuration + 1 ) ; // enough time for opening-animation to be done.
135
135
expect ( element . open ) . to . be . true ;
136
136
element . open = false ;
137
137
const event = await listener ;
@@ -143,7 +143,7 @@ describe('UUIToastNotificationElement', () => {
143
143
element . open = true ;
144
144
await elementUpdated ( element ) ;
145
145
const listener = oneEvent ( element , UUIToastNotificationEvent . CLOSED ) ;
146
- await sleep ( 100 ) ; // enough time for the rendering and opening-animation to start.
146
+ await sleep ( animationDuration / 2 ) ; // enough time for the rendering and opening-animation to start.
147
147
expect ( element . open ) . to . be . true ;
148
148
element . open = false ;
149
149
const event = await listener ;
@@ -165,7 +165,7 @@ describe('UUIToastNotificationElement', () => {
165
165
expect ( openEvent . type ) . to . equal ( UUIToastNotificationEvent . OPENING ) ;
166
166
expect ( element . open ) . to . be . true ;
167
167
168
- await sleep ( 100 ) ; // enough time for the rendering and opening-animation to start.
168
+ await sleep ( animationDuration / 2 ) ; // enough time for the rendering and opening-animation to start.
169
169
170
170
const closeListener = oneEvent (
171
171
element ,
0 commit comments