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 3c8d804
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
3 changes: 2 additions & 1 deletion test/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"it": false,
"expect": false,
"gemini": false,
"sinon": false
"sinon": false,
"flush": false
}
}
20 changes: 13 additions & 7 deletions test/animate-notification-test.html
Original file line number Diff line number Diff line change
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 3c8d804

Please # to comment.