Skip to content

Commit f8d3869

Browse files
committed
test --uui-toast-notification-animation-duration
1 parent cf6b383 commit f8d3869

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,19 @@ function sleep(ms: number) {
1818
return new Promise(resolve => setTimeout(resolve, ms));
1919
}
2020

21+
const animationDuration: number = 25; // still needs to be some time, otherwise it goes too fast for the rendering and the test to work properly.
22+
2123
describe('UUIToastNotificationElement', () => {
2224
let element: UUIToastNotificationElement;
2325

2426
beforeEach(async () => {
2527
element = await fixture(
2628
html` <uui-toast-notification></uui-toast-notification> `
2729
);
30+
element.style.setProperty(
31+
'--uui-toast-notification-animation-duration',
32+
animationDuration + 'ms'
33+
);
2834
});
2935

3036
it('passes the a11y audit', async () => {
@@ -50,6 +56,14 @@ describe('UUIToastNotificationElement', () => {
5056
it('has a resumeAutoClose method', () => {
5157
expect(element).to.have.property('resumeAutoClose').that.is.a('function');
5258
});
59+
it('private _getAnimationDuration', () => {
60+
expect(element)
61+
.to.have.property('_getAnimationDuration')
62+
.that.is.a('function');
63+
expect((element as any)._getAnimationDuration()).to.be.equal(
64+
animationDuration
65+
);
66+
});
5367
});
5468

5569
describe('template', () => {

0 commit comments

Comments
 (0)