UNPKG

devextreme

Version:

JavaScript/TypeScript Component Suite for Responsive Web Development

54 lines (53 loc) 2.57 kB
/** * DevExtreme (cjs/__internal/grids/pivot_grid/field_chooser/utils.test.js) * Version: 25.2.7 * Build date: Tue May 05 2026 * * Copyright (c) 2012 - 2026 Developer Express Inc. ALL RIGHTS RESERVED * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/ */ "use strict"; var _globals = require("@jest/globals"); var _utils = require("./utils"); (0, _globals.describe)("shouldCancelDragging", () => { (0, _globals.it)("should return false when field is undefined", () => { (0, _globals.expect)((0, _utils.shouldCancelDragging)(void 0, "column")).toBe(false); (0, _globals.expect)((0, _utils.shouldCancelDragging)(void 0, "row")).toBe(false); (0, _globals.expect)((0, _utils.shouldCancelDragging)(void 0, "filter")).toBe(false); (0, _globals.expect)((0, _utils.shouldCancelDragging)(void 0, "data")).toBe(false) }); (0, _globals.it)("should return true when isMeasure is true and target is column", () => { (0, _globals.expect)((0, _utils.shouldCancelDragging)({ isMeasure: true }, "column")).toBe(true) }); (0, _globals.it)("should return true when isMeasure is true and target is row", () => { (0, _globals.expect)((0, _utils.shouldCancelDragging)({ isMeasure: true }, "row")).toBe(true) }); (0, _globals.it)("should return true when isMeasure is true and target is filter", () => { (0, _globals.expect)((0, _utils.shouldCancelDragging)({ isMeasure: true }, "filter")).toBe(true) }); (0, _globals.it)("should return false when isMeasure is true and target is data", () => { (0, _globals.expect)((0, _utils.shouldCancelDragging)({ isMeasure: true }, "data")).toBe(false) }); (0, _globals.it)("should return true when isMeasure is false and target is data", () => { (0, _globals.expect)((0, _utils.shouldCancelDragging)({ isMeasure: false }, "data")).toBe(true) }); (0, _globals.it)("should return false when isMeasure is false and target is column", () => { (0, _globals.expect)((0, _utils.shouldCancelDragging)({ isMeasure: false }, "column")).toBe(false) }); (0, _globals.it)("should return false when isMeasure is undefined", () => { (0, _globals.expect)((0, _utils.shouldCancelDragging)({}, "data")).toBe(false); (0, _globals.expect)((0, _utils.shouldCancelDragging)({}, "column")).toBe(false) }) });