devextreme
Version:
HTML5 JavaScript Component Suite for Responsive Web Development
41 lines (40 loc) • 2.24 kB
JavaScript
/**
* DevExtreme (esm/__internal/scheduler/a11y_status/a11y_status_text.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 {
getA11yStatusText
} from "./a11y_status_text";
describe("getA11yStatusText", (() => {
it("should return text custom view", (() => {
expect(getA11yStatusText({
name: "Two Weeks",
type: "week",
intervalCount: 2
}, new Date(2021, 10, 17, 1), new Date(2021, 10, 27, 12), 20)).toEqual("Scheduler. Two Weeks view: from November 17, 2021 to November 27, 2021 with 20 appointments")
}));
it("should return text month view", (() => {
expect(getA11yStatusText("month", new Date(2021, 9, 27, 1), new Date(2021, 11, 3, 12), 20)).toEqual("Scheduler. Month view: from October 2021 to December 2021 with 20 appointments")
}));
it("should return text week view", (() => {
expect(getA11yStatusText("week", new Date(2021, 10, 21, 1), new Date(2021, 10, 27, 12), 20)).toEqual("Scheduler. Week view: from November 21, 2021 to November 27, 2021 with 20 appointments")
}));
it("should return text day view", (() => {
expect(getA11yStatusText("day", new Date(2021, 10, 24, 1), new Date(2021, 10, 24, 12), 20)).toEqual("Scheduler. Day view: November 24, 2021 with 20 appointments")
}));
it("should return text with indicator on the view", (() => {
expect(getA11yStatusText("day", new Date(2021, 10, 24, 1), new Date(2021, 10, 24, 12), 20, new Date(2021, 10, 24, 10))).toEqual("Scheduler. Day view: November 24, 2021 with 20 appointments. The current time indicator is visible in the view")
}));
it("should return text with indicator out of the view", (() => {
expect(getA11yStatusText("day", new Date(2021, 10, 24, 1), new Date(2021, 10, 24, 12), 20, new Date(2021, 10, 12, 10))).toEqual("Scheduler. Day view: November 24, 2021 with 20 appointments. The current time indicator is not visible on the screen")
}))
}));