Commit 8ed8c4d0 authored by David Stutz's avatar David Stutz

Updated tests and fixed select all + clickable + collapsible issues.

parent 3a5c6069
This diff is collapsed.
...@@ -2322,6 +2322,39 @@ ...@@ -2322,6 +2322,39 @@
}); });
}); });
</script> </script>
</pre>
</div>
<p>
The select all element naturally respects disabled elements:
</p>
<div class="example">
<script type="text/javascript">
$(document).ready(function() {
$('#example-includeSelectAllOption-disbled').multiselect({
includeSelectAllOption: true
});
});
</script>
<select id="example-includeSelectAllOption-disbled" multiple="multiple">
<option value="1" disabled="disabled">Option 1</option>
<option value="2">Option 2</option>
<option value="3">Option 3</option>
<option value="4">Option 4</option>
<option value="5">Option 5</option>
<option value="6">Option 6</option>
</select>
</div>
<div class="highlight">
<pre class="prettyprint linenums">
&lt;script type="text/javascript"&gt;
$(document).ready(function() {
$('#example-includeSelectAllOption-disbled').multiselect({
includeSelectAllOption: true
});
});
&lt;/script&gt;
</pre> </pre>
</div> </div>
</td> </td>
......
...@@ -516,14 +516,16 @@ describe('Bootstrap Multiselect "Collapsible Optgroups"', function() { ...@@ -516,14 +516,16 @@ describe('Bootstrap Multiselect "Collapsible Optgroups"', function() {
var $lis = $group.nextUntil('li.multiselect-group'); var $lis = $group.nextUntil('li.multiselect-group');
$lis.each(function() { $lis.each(function() {
expect($(this).hasClass('multiselect-collapsible-hidden')).toBe(false); expect($(this).hasClass('multiselect-collapsible-hidden')).toBe(true);
expect($(this).hasClass('multiselect-collapsible-hidden')).toBe($(this).is(':hidden'));
}); });
$('.caret-container', $group).click(); $('.caret-container', $group).click();
var $lis = $group.nextUntil('li.multiselect-group'); var $lis = $group.nextUntil('li.multiselect-group');
$lis.each(function() { $lis.each(function() {
expect($(this).hasClass('multiselect-collapsible-hidden')).toBe(true); expect($(this).hasClass('multiselect-collapsible-hidden')).toBe(false);
expect($(this).hasClass('multiselect-collapsible-hidden')).toBe($(this).is(':hidden'));
}); });
}); });
...@@ -616,14 +618,16 @@ describe('Bootstrap Multiselect "Clickable+Collapsible Optgroups"', function() { ...@@ -616,14 +618,16 @@ describe('Bootstrap Multiselect "Clickable+Collapsible Optgroups"', function() {
var $lis = $group.nextUntil('li.multiselect-group'); var $lis = $group.nextUntil('li.multiselect-group');
$lis.each(function() { $lis.each(function() {
expect($(this).hasClass('multiselect-collapsible-hidden')).toBe(false); expect($(this).hasClass('multiselect-collapsible-hidden')).toBe(true);
expect($(this).hasClass('multiselect-collapsible-hidden')).toBe($(this).is(':hidden'));
}); });
$('.caret-container', $group).click(); $('.caret-container', $group).click();
var $lis = $group.nextUntil('li.multiselect-group'); var $lis = $group.nextUntil('li.multiselect-group');
$lis.each(function() { $lis.each(function() {
expect($(this).hasClass('multiselect-collapsible-hidden')).toBe(true); expect($(this).hasClass('multiselect-collapsible-hidden')).toBe(false);
expect($(this).hasClass('multiselect-collapsible-hidden')).toBe($(this).is(':hidden'));
}); });
}); });
...@@ -664,7 +668,6 @@ describe('Bootstrap Multiselect "Clickable+Collapsible+SelectAll Optgroups"', fu ...@@ -664,7 +668,6 @@ describe('Bootstrap Multiselect "Clickable+Collapsible+SelectAll Optgroups"', fu
it('Should handle option groups differently, i.e. not set class to active.', function() { it('Should handle option groups differently, i.e. not set class to active.', function() {
// Otherwise they are hidden. // Otherwise they are hidden.
$('#multiselect-container li.multiselect-group .caret-container').click();
$('#multiselect-container input[value="multiselect-all"]').click(); $('#multiselect-container input[value="multiselect-all"]').click();
var $groups = $('#multiselect-container li.multiselect-group'); var $groups = $('#multiselect-container li.multiselect-group');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment