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

Commit fb1bc85

Browse files
committed
Add test for uiSelectHeaderGroupSelectable directive
1 parent 64b6ab1 commit fb1bc85

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

test/select.spec.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1882,6 +1882,7 @@ describe('ui-select tests', function () {
18821882
if (attrs.refreshDelay !== undefined) { choicesAttrsHtml += ' refresh-delay="' + attrs.refreshDelay + '"'; }
18831883
if (attrs.spinnerEnabled !== undefined) { attrsHtml += ' spinner-enabled="' + attrs.spinnerEnabled + '"'; }
18841884
if (attrs.spinnerClass !== undefined) { attrsHtml += ' spinner-class="' + attrs.spinnerClass + '"'; }
1885+
if (attrs.uiSelectHeaderGroupSelectable !== undefined) { choicesAttrsHtml += ' ui-select-header-group-selectable'; }
18851886
}
18861887

18871888
return compileTemplate(
@@ -3054,6 +3055,23 @@ describe('ui-select tests', function () {
30543055
expect(el.scope().$select.spinnerClass).toBe('randomclass');
30553056
});
30563057
});
3058+
3059+
describe('uiSelectHeaderGroupSelectable directive', function () {
3060+
it('should have a default value of false', function () {
3061+
var el = createUiSelectMultiple({ groupBy: "'age'", uiSelectHeaderGroupSelectable: true });
3062+
var ctrl = el.scope().$select;
3063+
3064+
showChoicesForSearch(el, '');
3065+
expect(ctrl.multiple).toEqual(true);
3066+
expect(ctrl.groups.length).toEqual(5);
3067+
openDropdown(el);
3068+
3069+
$(el).find('div.ui-select-header-group-selectable').first().click();
3070+
showChoicesForSearch(el, '');
3071+
3072+
expect(ctrl.selected.length).toEqual(2);
3073+
});
3074+
})
30573075
});
30583076

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

0 commit comments

Comments
 (0)