35 lines
1.4 KiB
JavaScript
35 lines
1.4 KiB
JavaScript
define(["require", "exports", "./overflow"], function (require, exports, overflow_1) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
describe('overflow', function () {
|
|
it('returns false when no overflow is present', function () {
|
|
expect((0, overflow_1.hasOverflow)({
|
|
clientWidth: 10,
|
|
clientHeight: 10,
|
|
scrollWidth: 10,
|
|
scrollHeight: 10,
|
|
})).toEqual(false);
|
|
});
|
|
it('detects horizontal overflow', function () {
|
|
var elementWithOverflow = {
|
|
clientWidth: 10,
|
|
clientHeight: 10,
|
|
scrollWidth: 20,
|
|
scrollHeight: 10,
|
|
};
|
|
expect((0, overflow_1.hasOverflow)(elementWithOverflow)).toEqual(true);
|
|
expect((0, overflow_1.hasHorizontalOverflow)(elementWithOverflow)).toEqual(true);
|
|
});
|
|
it('detects vertical overflow', function () {
|
|
var elementWithOverflow = {
|
|
clientWidth: 10,
|
|
clientHeight: 10,
|
|
scrollWidth: 10,
|
|
scrollHeight: 20,
|
|
};
|
|
expect((0, overflow_1.hasOverflow)(elementWithOverflow)).toEqual(true);
|
|
expect((0, overflow_1.hasVerticalOverflow)(elementWithOverflow)).toEqual(true);
|
|
});
|
|
});
|
|
});
|
|
//# sourceMappingURL=overflow.test.js.map
|