Skip to content

Commit df9b233

Browse files
committed
Added test for tagging mode to not alter model values
Motivation: Fix angular-ui#540
1 parent 137915e commit df9b233

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/select.spec.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,14 @@ describe('ui-select tests', function() {
340340

341341
expect($(el).scope().$select.selected).toEqual("I don't exist");
342342
});
343+
344+
it('should keep the model intact when the tagging attribute is defined', function() {
345+
scope.selection.selected.push("I am not on the list of choices");
346+
var el = createUiSelect({tagging: true});
347+
clickMatch(el);
348+
349+
expect($(el).scope().$select.selected).toEqual("I am not on the list of choices");
350+
});
343351

344352
it('should format new items using the tagging function when the attribute is a function', function() {
345353
scope.taggingFunc = function (name) {

0 commit comments

Comments
 (0)