mirror of
				https://github.com/ether/etherpad-lite.git
				synced 2025-10-31 00:01:16 +01:00 
			
		
		
		
	Fixed "jumps to a revision given in the url" test
This commit is contained in:
		
							parent
							
								
									f65ad93fb9
								
							
						
					
					
						commit
						ae6a9c25ae
					
				| @ -98,32 +98,47 @@ describe("timeslider", function(){ | |||||||
|       }, 6000); |       }, 6000); | ||||||
|     }, revs*timePerRev); |     }, 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) { |   it("jumps to a revision given in the url", function(done) { | ||||||
|     var inner$ = helper.padInner$;  |     var inner$ = helper.padInner$;  | ||||||
|     var chrome$ = helper.padChrome$; |     var chrome$ = helper.padChrome$; | ||||||
|     this.timeout(15000); |     this.timeout(20000); | ||||||
|  | 
 | ||||||
|  |     // wait for the text to be loaded
 | ||||||
|  |     helper.waitFor(function(){ | ||||||
|  |       return inner$('body').text().length != 0; | ||||||
|  |     }, 6000).always(function() { | ||||||
|  |       var newLines = inner$('body div').length; | ||||||
|  |       var oldLength = inner$('body').text().length + newLines / 2; | ||||||
|  |       expect( oldLength ).to.not.eql( 0 ); | ||||||
|       inner$("div").first().sendkeys('a'); |       inner$("div").first().sendkeys('a'); | ||||||
|        |        | ||||||
|     setTimeout(function() { |       // wait for our additional revision to be added
 | ||||||
|  |       helper.waitFor(function(){ | ||||||
|  |         // newLines takes the new lines into account which are strippen when using
 | ||||||
|  |         // inner$('body').text(), one <div> is used for one line in ACE.
 | ||||||
|  |         var lenOkay = inner$('body').text().length + newLines / 2 != oldLength; | ||||||
|  |         // this waits for the color to be added to our <span>, which means that the revision
 | ||||||
|  |         // was accepted by the server.
 | ||||||
|  |         var colorOkay = inner$('span').first().attr('class').indexOf("author-") == 0; | ||||||
|  |         return lenOkay && colorOkay; | ||||||
|  |       }, 6000).always(function() { | ||||||
|         // go to timeslider with a specific revision set
 |         // go to timeslider with a specific revision set
 | ||||||
|         $('#iframe-container iframe').attr('src', $('#iframe-container iframe').attr('src')+'/timeslider#0'); |         $('#iframe-container iframe').attr('src', $('#iframe-container iframe').attr('src')+'/timeslider#0'); | ||||||
|       var timeslider$; |  | ||||||
|          |          | ||||||
|  |         // wait for the timeslider to be loaded
 | ||||||
|         helper.waitFor(function(){ |         helper.waitFor(function(){ | ||||||
|         try{ |           try { | ||||||
|             timeslider$ = $('#iframe-container iframe')[0].contentWindow.$; |             timeslider$ = $('#iframe-container iframe')[0].contentWindow.$; | ||||||
|         }catch(e){ |           } catch(e){} | ||||||
|         } |  | ||||||
|           if(timeslider$){ |           if(timeslider$){ | ||||||
|           return timeslider$('#padcontent').text().length == 230; |             return timeslider$('#padcontent').text().length == oldLength; | ||||||
|           } |           } | ||||||
|         }, 6000).always(function(){ |         }, 6000).always(function(){ | ||||||
|         expect( timeslider$('#padcontent').text().length ).to.eql( 230 ); |           expect( timeslider$('#padcontent').text().length ).to.eql( oldLength ); | ||||||
|           done(); |           done(); | ||||||
|         }); |         }); | ||||||
|     }, 2500); |       }); | ||||||
|  |     }); | ||||||
|   }); |   }); | ||||||
|   it("checks the export url", function(done) { |   it("checks the export url", function(done) { | ||||||
|     var inner$ = helper.padInner$;  |     var inner$ = helper.padInner$;  | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user