forked from bitovi/jquerypp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathselection_test.js
More file actions
29 lines (25 loc) · 746 Bytes
/
selection_test.js
File metadata and controls
29 lines (25 loc) · 746 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
steal("jquery", "funcunit/qunit", "jquerypp/dom/selection").then(function($) {
module("jquerypp/dom/selection");
test("getCharElement", function(){
$("#qunit-test-area")
.html("<textarea>012\n456</textarea>"+
"<input text='text' value='01234567' id='inp'/>"+
"<p id='1'>0123456789</p>"+
"<div id='2'>012<div>3<span>4</span>5</div></div>");
stop();
setTimeout(function(){
var types = ['textarea','#inp','#1','#2'];
/*
$('textarea').selection(1,5);
$('input').selection(1,5);
$('#1').selection(1,5);
$('#2').selection(1,5);
*/
for(var i = 0; i < types.length; i++){
$(types[i]).selection(1, 5);
same($(types[i]).selection(), {start: 1, end: 5, width: 4}, types[i]);
}
start();
},1000)
});
});