devextreme
Version:
HTML5 JavaScript Component Suite for Responsive Web Development
44 lines (43 loc) • 1.41 kB
JavaScript
/**
* DevExtreme (esm/__internal/scheduler/r1/utils/views.test.js)
* Version: 25.1.3
* Build date: Wed Jun 25 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 {
getCurrentView
} from "./views";
describe("views utils", (() => {
describe("getCurrentView", (() => {
it("should return string", (() => {
expect(getCurrentView("agenda", ["agenda"])).toBe("agenda")
}));
it("should return view by type", (() => {
expect(getCurrentView("agenda", ["month", {
type: "agenda"
}])).toEqual({
type: "agenda"
})
}));
it("should return view by name", (() => {
expect(getCurrentView("agenda", ["month", {
type: "agenda"
}])).toEqual({
type: "agenda"
})
}));
it("should return default view if it doesn't set", (() => {
expect(getCurrentView("agenda", ["month"])).toBe("agenda")
}));
it("should return first view if nothing found", (() => {
expect(getCurrentView("agendaShort", ["agendaUnknown"])).toBe("agendaUnknown")
}))
}))
}));