Skip to content

Commit

Permalink
Fix failing tests in polyfilled browsers
Browse files Browse the repository at this point in the history
  • Loading branch information
web-padawan committed Mar 6, 2018
1 parent 2da5082 commit 8b49cee
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/multiple-notification-test.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
:host {
width: 200px;
background: lightgrey;
animation: none !important;
}
</style>
</template>
Expand Down Expand Up @@ -119,11 +120,12 @@
window.console.warn = warnOrig;
});

it('should remove notification from the region when it is closed', () => {
it('should remove notification from the region when it is closed', done => {
const e = notifications[1];
e.close();
setTimeout(() => {
expect(e._card.parentNode).not.to.be.ok;
done();
});
});

Expand All @@ -132,7 +134,7 @@
'top-start', 'top-center', 'top-end'
].forEach(regionName => {
const notifications = Array.from(container.querySelectorAll(`vaadin-notification-card[slot="${regionName}"]`));
expect(notifications[0].getBoundingClientRect().y).to.be.below(notifications[1].getBoundingClientRect().y);
expect(notifications[0].offsetTop).to.be.below(notifications[1].offsetTop);
expect(notifications[0].innerText.trim()).to.be.equal('Notificaton 2');
expect(notifications[1].innerText.trim()).to.be.equal('Notificaton 1');
});
Expand Down

0 comments on commit 8b49cee

Please sign in to comment.