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

Commit cb75ecf

Browse files
committed
Merge pull request #1448 from Magador/master
test(uiSelectDirective): Add test when merging ngClass attributes on uiSelect
2 parents c6eb055 + 00c719c commit cb75ecf

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/select.spec.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ describe('ui-select tests', function() {
128128
if (attrs.appendToBody !== undefined) { attrsHtml += ' append-to-body="' + attrs.appendToBody + '"'; }
129129
if (attrs.allowClear !== undefined) { matchAttrsHtml += ' allow-clear="' + attrs.allowClear + '"';}
130130
if (attrs.inputId !== undefined) { attrsHtml += ' input-id="' + attrs.inputId + '"'; }
131+
if (attrs.ngClass !== undefined) { attrsHtml += ' ng-class="' + attrs.ngClass + '"'; }
131132
}
132133

133134
return compileTemplate(
@@ -375,6 +376,14 @@ describe('ui-select tests', function() {
375376
expect(getMatchLabel(el)).toEqual('Adam');
376377
});
377378

379+
it('should merge both ng-class attributes defined on ui-select and its templates', function() {
380+
var el = createUiSelect({
381+
ngClass: "{class: expression}"
382+
});
383+
384+
expect($(el).attr('ng-class')).toEqual("{class: expression, open: $select.open}");
385+
});
386+
378387
it('should correctly render initial state with track by feature', function() {
379388
var el = compileTemplate(
380389
'<ui-select ng-model="selection.selected"> \

0 commit comments

Comments
 (0)