Skip to content

Commit

Permalink
fix for basic.hmt test: selectIndex(). Trigger async function to chec…
Browse files Browse the repository at this point in the history
…k initial selection, PolymerElements#126
  • Loading branch information
globits committed Mar 13, 2017
1 parent 74cc0d7 commit cad51a7
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions test/basic.html
Original file line number Diff line number Diff line change
Expand Up @@ -167,19 +167,22 @@
});

test('`selectIndex()` selects an item with the given index', function() {
assert.equal(s2.selectedItem, s2.items[2]);
Polymer.Base.async(function() {
assert.equal(s2.selected, 'item2');
assert.equal(s2.selectedItem, s2.items[2]);

s2.selectIndex(1);
assert.equal(s2.selected, 'item1');
assert.equal(s2.selectedItem, s2.items[1]);
s2.selectIndex(1);
assert.equal(s2.selected, 'item1');
assert.equal(s2.selectedItem, s2.items[1]);

s2.selectIndex(3);
assert.equal(s2.selected, 'item3');
assert.equal(s2.selectedItem, s2.items[3]);
s2.selectIndex(3);
assert.equal(s2.selected, 'item3');
assert.equal(s2.selectedItem, s2.items[3]);

s2.selectIndex(4);
assert.equal(s2.selected, 'item4');
assert.equal(s2.selectedItem, s2.items[4]);
s2.selectIndex(4);
assert.equal(s2.selected, 'item4');
assert.equal(s2.selectedItem, s2.items[4]);
}, 1);
});
});

Expand Down

0 comments on commit cad51a7

Please sign in to comment.