Skip to content

Commit

Permalink
Force tests to wait a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
davidrleonard committed Dec 20, 2017
1 parent 0efafd7 commit 60a0726
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions test/px-context-browser-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -378,41 +378,41 @@ describe('px-context-browser [favorited behaviors]', () => {
browser.favorited = [items[0], items[1]];
favoritedTrigger.click();

flushAndRender(() => {
setTimeout(() => {
const panel = Polymer.dom(browser.root).querySelector('#favoritedPanel');
let panelRect = panel.getBoundingClientRect();
expect(panelRect.left > 0).to.be.true;
expect(panelRect.left).to.be.greaterThan(0);
expect(panelRect.height).to.be.closeTo(140, 5);

browser.favorite(items[1].children[0]);
setTimeout(() => {
let panelRect = panel.getBoundingClientRect();
expect(panelRect.left > 0).to.be.true;
expect(panelRect.left).to.be.greaterThan(0);
expect(panelRect.height).to.be.closeTo(200, 5);
done();
}, 1000);
}, 10);
}, 2000);
}, 2000);
});

it('updates the panel height to show the correct number of items in the Favorites Panel when items are filtered', (done) => {
browser.favorited = [items[0], items[1], items[1].children[0]];
browser.showFilter = true;
favoritedTrigger.click();

flush(() => {
setTimeout(() => {
const panel = Polymer.dom(browser.root).querySelector('#favoritedPanel');
let panelRect = panel.getBoundingClientRect();
expect(panelRect.left > 0).to.be.true;
expect(panelRect.left).to.be.greaterThan(0);
expect(panelRect.height).to.be.closeTo(252, 5);

browser.favoritedFilter = "h";
setTimeout(() => {
let panelRect = panel.getBoundingClientRect();
expect(panelRect.left > 0).to.be.true;
expect(panelRect.left).to.be.greaterThan(0);
expect(panelRect.height).to.be.closeTo(132, 5);
done();
}, 1000);
});
}, 2000);
}, 2000);
});

});

0 comments on commit 60a0726

Please sign in to comment.