Skip to content

Commit

Permalink
test for function _valueForItem
Browse files Browse the repository at this point in the history
test if function _valueForItem handles null item
_valueForItem handles null attr
  • Loading branch information
programmer4web committed May 4, 2018
1 parent 3759e5d commit d6585c7
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/basic.html
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,20 @@
assert.equal(tabs.fallbackSelection, 'tab0');
assert.equal(tabs.selected, 'tab0');
});

test('_valueForItem handles null item', () => {
assert.isUndefined(tabs._valueForItem());
assert.isUndefined(tabs._valueForItem(null));
});

test('_valueForItem handles null attrForSelected', done => {
tabs.attrForSelected = null;
assert.deepEqual(tabs.selectedItem, tabs.items[0]);
assert.equal(tabs._valueForItem(tabs.selectedItem), 0);
assert.equal(tabs._valueForItem(tabs.items[1]), 1);
assert.equal(tabs._valueForItem(tabs.items[2]), 2);
done();
});
});

suite('basic', function () {
Expand Down

0 comments on commit d6585c7

Please sign in to comment.