Skip to content

Commit

Permalink
fix(tests): IE 11 animation cleanup test timing
Browse files Browse the repository at this point in the history
  • Loading branch information
platosha committed Mar 26, 2019
1 parent c318d35 commit 86ff085
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions test/animate-notification-test.html
Expand Up @@ -74,8 +74,10 @@

it('should remove card after animation', done => {
notifications[1]._card.addEventListener('animationend', () => {
expect(notifications[1]._card.parentNode).not.to.be.ok;
done();
flush(() => {
expect(notifications[1]._card.parentNode).not.to.be.ok;
done();
});
});
});

Expand All @@ -90,17 +92,21 @@
expect(notifications[0]._card.hasAttribute('closing')).to.be.false;
expect(notifications[1]._card.hasAttribute('closing')).to.be.true;
notifications[1]._card.addEventListener('animationend', () => {
expect(notifications[0]._card.hasAttribute('closing')).to.be.false;
expect(notifications[1]._card.hasAttribute('closing')).to.be.false;
done();
flush(() => {
expect(notifications[0]._card.hasAttribute('closing')).to.be.false;
expect(notifications[1]._card.hasAttribute('closing')).to.be.false;
done();
});
});
});

it('should set `opening` attribute and remove later', done => {
expect(notifications[1]._card.hasAttribute('opening')).to.be.true;
notifications[1]._card.addEventListener('animationend', () => {
expect(notifications[1]._card.hasAttribute('opening')).to.be.false;
done();
flush(() => {
expect(notifications[1]._card.hasAttribute('opening')).to.be.false;
done();
});
});
});
});
Expand Down

0 comments on commit 86ff085

Please sign in to comment.