diff --git a/tests/data/array-tests.js b/tests/data/array-tests.js index 6096ecfa..65a6e32c 100644 --- a/tests/data/array-tests.js +++ b/tests/data/array-tests.js @@ -288,3 +288,31 @@ test('optgroup tags have the right properties', function (assert) { 'The should have one child under it' ); }); + +test('existing selections are respected on initialization', function (assert) { + var $select = $( + '' + ); + + var options = new Options({ + data: [ + { + id: 'Second', + text: 'Second' + }, + { + id: 'Third', + text: 'Third' + } + ] + }); + + assert.equal($select.val(), 'Second'); + + var data = new ArrayData($select, options); + + assert.equal($select.val(), 'Second'); +}); \ No newline at end of file