special king clothes

scroll-to-line-with-scroll.js
John McLear 2020-12-11 14:30:16 +00:00
parent 1956b29093
commit 78fe277ac6
1 changed files with 22 additions and 1 deletions

View File

@ -10,7 +10,6 @@ describe('scrolls to line', function () {
this.timeout(10000); this.timeout(10000);
}); });
it('Scrolls down to Line 4', function (done) { it('Scrolls down to Line 4', function (done) {
this.timeout(10000); this.timeout(10000);
const chrome$ = helper.padChrome$; const chrome$ = helper.padChrome$;
@ -22,3 +21,25 @@ describe('scrolls to line', function () {
done(); 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();
});
});