"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var helpers_1 = require("./helpers");
describe('helpers tests', function () {
    describe('adjustVerticalPopupLayout tests', function () {
        it('should return top vertical origin if popup fits to the bottom', function () {
            var anchorEl = document.createElement('div');
            anchorEl.getBoundingClientRect = jest.fn(function () {
                return { top: 100, bottom: 200 };
            });
            var popupHeight = 50;
            var result = (0, helpers_1.adjustVerticalPopupLayout)(anchorEl, popupHeight);
            expect(result).toEqual({ verticalOrigin: 'top', popupHeight: popupHeight });
        });
        it('should return correct height', function () {
            var originalInnerHeight = global.innerHeight;
            global.innerHeight = 600;
            var anchorEl = document.createElement('div');
            anchorEl.getBoundingClientRect = jest.fn(function () {
                return { top: 540, bottom: 580 };
            });
            var popupHeight = 574;
            var result = (0, helpers_1.adjustVerticalPopupLayout)(anchorEl, popupHeight);
            expect(result).toEqual({ verticalOrigin: 'bottom', popupHeight: 564 });
            global.innerHeight = originalInnerHeight;
        });
    });
});
