Refine timeslider test
parent
103e0f6747
commit
80ce0b5edb
|
@ -11,39 +11,50 @@ describe("timeslider", function(){
|
||||||
|
|
||||||
// make some changes to produce 100 revisions
|
// make some changes to produce 100 revisions
|
||||||
var timePerRev = 900
|
var timePerRev = 900
|
||||||
, revs = 150;
|
, revs = 100;
|
||||||
this.timeout(revs*timePerRev+10000);
|
this.timeout(revs*timePerRev+10000);
|
||||||
for(var i=0; i < revs; i++) {
|
for(var i=0; i < revs; i++) {
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
// type 'a' in the first text element
|
// enter 'a' in the first text element
|
||||||
inner$("div").first().sendkeys('a');
|
inner$("div").first().sendkeys('a');
|
||||||
}, timePerRev*i);
|
}, timePerRev*i);
|
||||||
}
|
}
|
||||||
|
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
|
// go to timeslider
|
||||||
$('#iframe-container iframe').attr('src', $('#iframe-container iframe').attr('src')+'/timeslider');
|
$('#iframe-container iframe').attr('src', $('#iframe-container iframe').attr('src')+'/timeslider');
|
||||||
|
|
||||||
|
setTimeout(function() {
|
||||||
var timeslider$ = $('#iframe-container iframe')[0].contentWindow.$;
|
var timeslider$ = $('#iframe-container iframe')[0].contentWindow.$;
|
||||||
|
var $sliderBar = timeslider$('#ui-slider-bar');
|
||||||
|
|
||||||
var $sliderHandle = timeslider$('#timeslider-slider ui-slider-handle');
|
var latestContents = timeslider$('#padcontent').text();
|
||||||
/*
|
|
||||||
//get the strikethrough button and click it
|
|
||||||
var $strikethroughButton = chrome$(".buttonicon-strikethrough");
|
|
||||||
$strikethroughButton.click();
|
|
||||||
|
|
||||||
//ace creates a new dom element when you press a button, so just get the first text element again
|
// Click somewhere on the timeslider
|
||||||
var $newFirstTextElement = inner$("div").first();
|
var e = new jQuery.Event('mousedown');
|
||||||
|
e.clientX = e.pageX = 150;
|
||||||
|
e.clientY = e.pageY = 45;
|
||||||
|
$sliderBar.trigger(e);
|
||||||
|
|
||||||
// is there a <i> element now?
|
e = new jQuery.Event('mousedown');
|
||||||
var isstrikethrough = $newFirstTextElement.find("s").length === 1;
|
e.clientX = e.pageX = 150;
|
||||||
|
e.clientY = e.pageY = 40;
|
||||||
|
$sliderBar.trigger(e);
|
||||||
|
|
||||||
//expect it to be strikethrough
|
e = new jQuery.Event('mousedown');
|
||||||
expect(isstrikethrough).to.be(true);
|
e.clientX = e.pageX = 150;
|
||||||
|
e.clientY = e.pageY = 50;
|
||||||
|
$sliderBar.trigger(e);
|
||||||
|
|
||||||
//make sure the text hasn't changed
|
$sliderBar.trigger('mouseup')
|
||||||
expect($newFirstTextElement.text()).to.eql($firstTextElement.text());
|
|
||||||
*/
|
setTimeout(function() {
|
||||||
|
//make sure the text has changed
|
||||||
|
expect( timeslider$('#padcontent').text() ).not.to.eql( latestContents );
|
||||||
done();
|
done();
|
||||||
|
}, 1000);
|
||||||
|
|
||||||
|
}, 6000);
|
||||||
}, revs*timePerRev);
|
}, revs*timePerRev);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue