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

test(uiSelectDirective): Add test when merging ngClass attributes on uiSelect #1448

Merged
merged 1 commit into from
Mar 15, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -349,6 +350,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