diff --git a/tests/frontend/specs/scrollTo.js b/tests/frontend/specs/scrollTo.js index 7509cec1b..05489cf2a 100755 --- a/tests/frontend/specs/scrollTo.js +++ b/tests/frontend/specs/scrollTo.js @@ -10,7 +10,6 @@ describe('scrolls to line', function () { this.timeout(10000); }); - it('Scrolls down to Line 4', function (done) { this.timeout(10000); const chrome$ = helper.padChrome$; @@ -22,3 +21,25 @@ describe('scrolls to line', function () { done(); }); }); + +describe('doesnt break on weird hash input', function () { + // create a new pad with URL hash set before each test run + beforeEach(function (cb) { + helper.newPad({ + hash: '#DEEZ123123NUTS', + cb, + }); + this.timeout(10000); + }); + + it('Does NOT change scroll', function (done) { + this.timeout(10000); + const chrome$ = helper.padChrome$; + helper.waitFor(() => { + const topOffset = parseInt(chrome$('iframe').first('iframe') + .contents().find('#outerdocbody').css('top')); + return (!topOffset); // no css top should be set. + }); + done(); + }); +});