const helpers = require('./support/helpers'); const PADDING_BETWEEN_STICKYS = 40; const PADDING_BEFORE_STOPPING_POINT = 10; function getScreenItemBottomPosition (screenItem) { return screenItem.offsetTop + screenItem.offsetHeight; }; beforeAll(() => { require('../../app/assets/javascripts/stick-to-window-when-scrolling.js'); }); afterAll(() => { require('./support/teardown.js'); }); describe("Stick to top/bottom of window when scrolling", () => { let screenMock; describe("If intending to stick to the top", () => { let inputForm; let formFooter; let footer; let windowHeight; let getFurthestTopPoint; beforeEach(() => { document.body.innerHTML = `