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

Commit

Permalink
Add test for uiSelectHeaderGroupSelectable directive
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkIsDude committed Sep 6, 2017
1 parent 64b6ab1 commit fb1bc85
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/select.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1882,6 +1882,7 @@ describe('ui-select tests', function () {
if (attrs.refreshDelay !== undefined) { choicesAttrsHtml += ' refresh-delay="' + attrs.refreshDelay + '"'; }
if (attrs.spinnerEnabled !== undefined) { attrsHtml += ' spinner-enabled="' + attrs.spinnerEnabled + '"'; }
if (attrs.spinnerClass !== undefined) { attrsHtml += ' spinner-class="' + attrs.spinnerClass + '"'; }
if (attrs.uiSelectHeaderGroupSelectable !== undefined) { choicesAttrsHtml += ' ui-select-header-group-selectable'; }
}

return compileTemplate(
Expand Down Expand Up @@ -3054,6 +3055,23 @@ describe('ui-select tests', function () {
expect(el.scope().$select.spinnerClass).toBe('randomclass');
});
});

describe('uiSelectHeaderGroupSelectable directive', function () {
it('should have a default value of false', function () {
var el = createUiSelectMultiple({ groupBy: "'age'", uiSelectHeaderGroupSelectable: true });
var ctrl = el.scope().$select;

showChoicesForSearch(el, '');
expect(ctrl.multiple).toEqual(true);
expect(ctrl.groups.length).toEqual(5);
openDropdown(el);

$(el).find('div.ui-select-header-group-selectable').first().click();
showChoicesForSearch(el, '');

expect(ctrl.selected.length).toEqual(2);
});
})
});

it('should add an id to the search input field', function () {
Expand Down

0 comments on commit fb1bc85

Please sign in to comment.