Skip to content
This repository was archived by the owner on Oct 2, 2019. It is now read-only.

Commit 7c49685

Browse files
committed
test(choices): should throw when repeat attr has incorrect format
1 parent a4ad63a commit 7c49685

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/select.spec.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,17 @@ describe('ui-select tests', function() {
285285
}).toThrow(new Error('[ui.select:repeat] Expected \'repeat\' expression.'));
286286
});
287287

288+
it('should throw when repeat attribute has incorrect format ', function() {
289+
expect(function() {
290+
compileTemplate(
291+
'<ui-select ng-model="selection.selected"> \
292+
<ui-select-match></ui-select-match> \
293+
<ui-select-choices repeat="incorrect format people"></ui-select-choices> \
294+
</ui-select>'
295+
);
296+
}).toThrow(new Error('[ui.select:iexp] Expected expression in form of \'_item_ in _collection_[ track by _id_]\' but got \'incorrect format people\'.'));
297+
});
298+
288299
it('should throw when no ui-select-match found', function() {
289300
expect(function() {
290301
compileTemplate(

0 commit comments

Comments
 (0)