Skip to content

Commit 23f5c29

Browse files
committed
use --uui-toast-notification-animation-duration
1 parent f8d3869 commit 23f5c29

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

packages/uui-toast-notification/lib/uui-toast-notification.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ describe('UUIToastNotificationElement', () => {
9090
element.open = true;
9191
await elementUpdated(element);
9292
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.
9494
expect(element.open).to.be.true;
9595
element.open = false;
9696
const event = await listener;
@@ -102,7 +102,7 @@ describe('UUIToastNotificationElement', () => {
102102
element.open = true;
103103
await elementUpdated(element);
104104
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.
106106
expect(element.open).to.be.true;
107107
element.open = false;
108108
const event = await listener;
@@ -117,7 +117,7 @@ describe('UUIToastNotificationElement', () => {
117117
element.addEventListener(UUIToastNotificationEvent.CLOSING, e => {
118118
e.preventDefault();
119119
});
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.
121121
expect(element.open).to.be.true;
122122
element.open = false;
123123
const event = await listener;
@@ -131,7 +131,7 @@ describe('UUIToastNotificationElement', () => {
131131
element.open = true;
132132
await elementUpdated(element);
133133
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.
135135
expect(element.open).to.be.true;
136136
element.open = false;
137137
const event = await listener;
@@ -143,7 +143,7 @@ describe('UUIToastNotificationElement', () => {
143143
element.open = true;
144144
await elementUpdated(element);
145145
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.
147147
expect(element.open).to.be.true;
148148
element.open = false;
149149
const event = await listener;
@@ -165,7 +165,7 @@ describe('UUIToastNotificationElement', () => {
165165
expect(openEvent.type).to.equal(UUIToastNotificationEvent.OPENING);
166166
expect(element.open).to.be.true;
167167

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.
169169

170170
const closeListener = oneEvent(
171171
element,

0 commit comments

Comments
 (0)