From cad51a725be9c891753d42e9ca1eb041ccc36341 Mon Sep 17 00:00:00 2001 From: Globits Date: Mon, 13 Mar 2017 16:53:01 +0100 Subject: [PATCH] fix for basic.hmt test: selectIndex(). Trigger async function to check initial selection, #126 --- test/basic.html | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/test/basic.html b/test/basic.html index e9dbfc0..30768b5 100644 --- a/test/basic.html +++ b/test/basic.html @@ -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); }); });