Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
bootstrap-multiselect
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
bootstrap-multiselect
Commits
eba71302
Commit
eba71302
authored
Oct 17, 2014
by
Kyle Needham
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Created test for issue #405
parent
7375e5ee
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
1 deletion
+34
-1
bootstrap-multiselect.js
tests/spec/bootstrap-multiselect.js
+34
-1
No files found.
tests/spec/bootstrap-multiselect.js
View file @
eba71302
...
...
@@ -573,4 +573,37 @@ describe('Bootstrap Multiselect Specific Issues', function() {
$
(
'
#multiselect
'
).
multiselect
(
'
destroy
'
);
$
(
'
#multiselect
'
).
remove
();
});
});
\ No newline at end of file
it
(
'
#405
'
,
function
()
{
var
selection
=
document
.
getSelection
();
var
range
=
document
.
createRange
();
var
$selection
=
$
(
'
<span>Some text to select</span>
'
);
var
$select
=
$
(
'
<select id="multiselect" multiple="multiple"></select>
'
);
for
(
var
i
=
1
;
i
<
5
;
i
++
)
{
$select
.
append
(
'
<option value="
'
+
i
+
'
">select option</option>
'
);
}
$
(
'
body
'
).
append
(
$selection
).
append
(
$select
);
$select
.
multiselect
({
buttonContainer
:
'
<div id="multiselect-container"></div>
'
,
});
range
.
selectNodeContents
(
$selection
.
get
(
0
));
selection
.
removeAllRanges
();
selection
.
addRange
(
range
);
expect
(
document
.
getSelection
().
type
).
toBe
(
'
Range
'
);
expect
(
$
(
'
#multiselect-container
'
).
find
(
'
input:first
'
).
prop
(
'
checked
'
)).
toBe
(
false
);
$
(
'
#multiselect-container
'
).
find
(
'
a:first
'
).
trigger
(
'
click
'
);
expect
(
$
(
'
#multiselect-container
'
).
find
(
'
input:first
'
).
prop
(
'
checked
'
)).
toBe
(
true
);
$
(
'
#multiselect
'
).
multiselect
(
'
destroy
'
);
$
(
'
#multiselect
'
).
remove
();
$selection
.
remove
();
});
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment