Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
adjust tests since polymer-selector now adds tap listener after ready()
Browse files Browse the repository at this point in the history
  • Loading branch information
frankiefu committed Aug 6, 2013
1 parent fcfdfb8 commit ea120c6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions test/html/polymer-selector-activate-event.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
assert.equal(s.selected, 1);
done();
});
Platform.flush();
assert.equal(s.selected, 0);
s.children[1].dispatchEvent(new CustomEvent('tap', {bubbles: true}));
});
Expand Down
14 changes: 8 additions & 6 deletions test/html/polymer-selector-multi.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,16 @@
eventCounter++;
}
});
s.selected = [0, 2];
setTimeout(function() {
assert.equal(eventCounter, 2);
assert.isTrue(s.children[0].classList.contains('polymer-selected'));
assert.isTrue(s.children[2].classList.contains('polymer-selected'));
done();
s.selected = [0, 2];
Platform.flush();
setTimeout(function() {
assert.equal(eventCounter, 2);
assert.isTrue(s.children[0].classList.contains('polymer-selected'));
assert.isTrue(s.children[2].classList.contains('polymer-selected'));
done();
}.bind(this), 0);
}.bind(this), 0);

});
</script>
</body>
Expand Down

0 comments on commit ea120c6

Please sign in to comment.