mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-01-19 14:13:34 +01:00
69c7033a86
* don't include sendkeys in index.html as it's included in helper.init mocha opts: add default timeout and replace ignoreLeaks with checkLeaks, as the former is deprecated * introduce helper.edit to write to a pad * add test to check if helper.edit() supports line numbers * helper tests: waitFor/waitForPromise seem to be a little bit faster sometimes * tests: refactor chat.js * tests: refactor timeslider_numeric_padID * tests: refactor timeslider_labels * tests: refactor timeslider_follow * ensure followContents is enabled, although it should be by default * timeslider_follow: increase number of revision for Edge * make textLines() depend on linesDiv() Co-authored-by: Richard Hansen <rhansen@rhansen.org> * make linesDiv return standard Array * use `contain` instead of `indexOf` * more fixes from the review * review fixes * align waitFor and waitForPromise behaviour * timeslider_follow: check if it's following to the correct lines * lower expected waitFor/waitForPromise interval check * disable responsivness and regression test in timeslider_follow * timeslider_follow: fix Range detection * more explicit test for linesDiv Co-authored-by: Richard Hansen <rhansen@rhansen.org>
29 lines
1 KiB
JavaScript
29 lines
1 KiB
JavaScript
describe("timeslider", function(){
|
|
var padId = 735773577357+(Math.round(Math.random()*1000));
|
|
|
|
//create a new pad before each test run
|
|
beforeEach(function(cb){
|
|
helper.newPad(cb, padId);
|
|
});
|
|
|
|
it("Makes sure the export URIs are as expected when the padID is numeric", async function() {
|
|
await helper.edit('a\n');
|
|
|
|
await helper.gotoTimeslider(1);
|
|
|
|
// ensure we are on revision 1
|
|
await helper.waitForPromise(function(){return helper.contentWindow().location.hash === '#1'})
|
|
|
|
// expect URI to be similar to
|
|
// http://192.168.1.48:9001/p/2/1/export/html
|
|
// http://192.168.1.48:9001/p/735773577399/1/export/html
|
|
let rev1ExportLink = helper.contentWindow().$('#exporthtmla').attr('href');
|
|
expect(rev1ExportLink).to.contain('/1/export/html');
|
|
|
|
// Click somewhere left on the timeslider to go to revision 0
|
|
helper.sliderClick(30);
|
|
|
|
let rev0ExportLink = helper.contentWindow().$('#exporthtmla').attr('href');
|
|
expect(rev0ExportLink).to.contain('/0/export/html');
|
|
});
|
|
});
|