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

Commit

Permalink
Merge pull request #1448 from Magador/master
Browse files Browse the repository at this point in the history
test(uiSelectDirective): Add test when merging ngClass attributes on uiSelect
  • Loading branch information
aaronroberson committed Mar 15, 2016
2 parents c6eb055 + 00c719c commit cb75ecf
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/select.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ describe('ui-select tests', function() {
if (attrs.appendToBody !== undefined) { attrsHtml += ' append-to-body="' + attrs.appendToBody + '"'; }
if (attrs.allowClear !== undefined) { matchAttrsHtml += ' allow-clear="' + attrs.allowClear + '"';}
if (attrs.inputId !== undefined) { attrsHtml += ' input-id="' + attrs.inputId + '"'; }
if (attrs.ngClass !== undefined) { attrsHtml += ' ng-class="' + attrs.ngClass + '"'; }
}

return compileTemplate(
Expand Down Expand Up @@ -375,6 +376,14 @@ describe('ui-select tests', function() {
expect(getMatchLabel(el)).toEqual('Adam');
});

it('should merge both ng-class attributes defined on ui-select and its templates', function() {
var el = createUiSelect({
ngClass: "{class: expression}"
});

expect($(el).attr('ng-class')).toEqual("{class: expression, open: $select.open}");
});

it('should correctly render initial state with track by feature', function() {
var el = compileTemplate(
'<ui-select ng-model="selection.selected"> \
Expand Down

0 comments on commit cb75ecf

Please sign in to comment.