Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit ca509f0

Browse files
committed
this test fails differently in jqlite and jquery
1 parent 3c86212 commit ca509f0

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

test/ng/directive/ngOptionsSpec.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,33 @@ describe('ngOptions', function() {
298298

299299
});
300300

301+
iit('should render an array', function() {
302+
scope.metadata = {
303+
currencies: [{
304+
id: 'chf',
305+
symbol: 'CHF'
306+
}, {
307+
id: 'usd',
308+
symbol: 'USD'
309+
}]
310+
};
311+
scope.data = {
312+
selected: 'chf'
313+
};
314+
315+
createSelect({
316+
'ng-model': 'data.selected',
317+
'ng-options': 'option.id as option.symbol for option in metadata.currencies'
318+
});
319+
scope.$digest();
320+
321+
var options = element.find('option');
322+
expect(options.length).toEqual(2);
323+
expect(options.eq(0)).toEqualOption('chf', 'CHF');
324+
expect(element.find('option[selected]').length).toBe(1);
325+
expect(options.eq(0).attr('selected')).toBe('selected');
326+
327+
});
301328

302329
it('should render zero as a valid display value', function() {
303330
createSingleSelect();

0 commit comments

Comments
 (0)