summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJohn McLear <john@mclear.co.uk>2013-02-07 15:24:30 +0000
committerJohn McLear <john@mclear.co.uk>2013-02-07 15:24:30 +0000
commitf42d3820a5f495fbee4c5c1579b9c2daaf2e0e49 (patch)
tree37226d1b9754626efb294de6aa5b6629a033258f /tests
parente78879c3006c89b5eacde40885a0a59a136c9230 (diff)
downloadetherpad-lite-f42d3820a5f495fbee4c5c1579b9c2daaf2e0e49.zip
fix timeslider tests
Diffstat (limited to 'tests')
-rw-r--r--tests/frontend/specs/timeslider_revisions.js26
1 files changed, 15 insertions, 11 deletions
diff --git a/tests/frontend/specs/timeslider_revisions.js b/tests/frontend/specs/timeslider_revisions.js
index 52f48764..bb0696c7 100644
--- a/tests/frontend/specs/timeslider_revisions.js
+++ b/tests/frontend/specs/timeslider_revisions.js
@@ -4,7 +4,6 @@ describe("timeslider", function(){
helper.newPad(cb);
this.timeout(6000);
});
-
xit("loads adds a hundred revisions", function(done) {
var inner$ = helper.padInner$;
var chrome$ = helper.padChrome$;
@@ -57,14 +56,13 @@ describe("timeslider", function(){
}, 6000);
}, revs*timePerRev);
});
-
it("changes the url when clicking on the timeslider", function(done) {
var inner$ = helper.padInner$;
var chrome$ = helper.padChrome$;
// make some changes to produce 7 revisions
- var timePerRev = 900
- , revs = 7;
+ var timePerRev = 1000
+ , revs = 20;
this.timeout(revs*timePerRev+10000);
for(var i=0; i < revs; i++) {
setTimeout(function() {
@@ -100,28 +98,32 @@ describe("timeslider", function(){
}, 6000);
}, revs*timePerRev);
});
-
+
+ // This test is bad because it expects char length to be static
+ // A much better way would be get the charCount before sending new chars
it("jumps to a revision given in the url", function(done) {
var inner$ = helper.padInner$;
var chrome$ = helper.padChrome$;
- this.timeout(11000);
+ this.timeout(15000);
inner$("div").first().sendkeys('a');
setTimeout(function() {
- // go to timeslider
+ // go to timeslider with a specific revision set
$('#iframe-container iframe').attr('src', $('#iframe-container iframe').attr('src')+'/timeslider#0');
var timeslider$;
helper.waitFor(function(){
- timeslider$ = $('#iframe-container iframe')[0].contentWindow.$;
- return timeslider$ && timeslider$('#padcontent').text().length == 230;
+ try{
+ timeslider$ = $('#iframe-container iframe')[0].contentWindow.$;
+ }catch(e){
+ }
+ return timeslider$('#padcontent').text().length == 230;
}, 6000).always(function(){
expect( timeslider$('#padcontent').text().length ).to.eql( 230 );
done();
});
}, 2500);
});
-
it("checks the export url", function(done) {
var inner$ = helper.padInner$;
var chrome$ = helper.padChrome$;
@@ -135,7 +137,9 @@ describe("timeslider", function(){
var exportLink;
helper.waitFor(function(){
- timeslider$ = $('#iframe-container iframe')[0].contentWindow.$;
+ try{
+ timeslider$ = $('#iframe-container iframe')[0].contentWindow.$;
+ }catch(e){}
if(!timeslider$)
return false;
exportLink = timeslider$('#exportplaina').attr('href');