File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1414
1515 < script src ="helpers.js " type ="text/javascript "> </ script >
1616
17+ < script src ="integration/jquery-calls.js " type ="text/javascript "> </ script >
1718 < script src ="integration/select2-methods.js " type ="text/javascript "> </ script >
1819 </ body >
1920</ html >
Original file line number Diff line number Diff line change 1+ test ( 'multiple elements with arguments works' , function ( assert ) {
2+ var $ = require ( 'jquery' ) ;
3+ require ( 'jquery.select2' ) ;
4+
5+ var $first = $ (
6+ '<select>' +
7+ '<option>1</option>' +
8+ '<option>2</option>' +
9+ '</select>'
10+ ) ;
11+ var $second = $first . clone ( ) ;
12+
13+ var $both = $first . add ( $second ) ;
14+ $both . select2 ( ) ;
15+
16+ $both . select2 ( 'val' , '2' ) ;
17+
18+ assert . equal (
19+ $first . val ( ) ,
20+ '2' ,
21+ 'The call should change the value on the first element'
22+ ) ;
23+ assert . equal (
24+ $second . val ( ) ,
25+ '2' ,
26+ 'The call should also change the value on the second element'
27+ ) ;
28+ } ) ;
You can’t perform that action at this time.
0 commit comments