devextreme
Version:
HTML5 JavaScript Component Suite for Responsive Web Development
35 lines (34 loc) • 984 B
JavaScript
/**
* DevExtreme (esm/__internal/ui/scroll_view/utils/get_scrollbar_size.test.js)
* Version: 24.2.7
* Build date: Mon Apr 28 2025
*
* Copyright (c) 2012 - 2025 Developer Express Inc. ALL RIGHTS RESERVED
* Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
*/
import {
describe,
expect,
it
} from "@jest/globals";
import {
DIRECTION_HORIZONTAL,
DIRECTION_VERTICAL
} from "../consts";
import {
getScrollbarSize
} from "./get_scrollbar_size";
describe("getScrollbarSize(element, direction)", (() => {
it("get vertical scrollbar width", (() => {
expect(getScrollbarSize({
offsetWidth: 100,
clientWidth: 83
}, DIRECTION_VERTICAL)).toEqual(17)
}));
it("get horizontal scrollbar height", (() => {
expect(getScrollbarSize({
offsetHeight: 100,
clientHeight: 83
}, DIRECTION_HORIZONTAL)).toEqual(17)
}))
}));