Skip to content

Scheduler - Create isolated AppointmentPopup test environment#33002

Open
aleksei-semikozov wants to merge 1 commit intoDevExpress:26_1from
aleksei-semikozov:worktree-scheduler-popup-env-3718
Open

Scheduler - Create isolated AppointmentPopup test environment#33002
aleksei-semikozov wants to merge 1 commit intoDevExpress:26_1from
aleksei-semikozov:worktree-scheduler-popup-env-3718

Conversation

@aleksei-semikozov
Copy link
Contributor

@aleksei-semikozov aleksei-semikozov commented Mar 20, 2026

No description provided.

@aleksei-semikozov aleksei-semikozov force-pushed the worktree-scheduler-popup-env-3718 branch from d9420d7 to 1385ce5 Compare March 20, 2026 20:23
@aleksei-semikozov aleksei-semikozov marked this pull request as ready for review March 23, 2026 15:21
@aleksei-semikozov aleksei-semikozov requested a review from a team as a code owner March 23, 2026 15:21
Copilot AI review requested due to automatic review settings March 23, 2026 15:21
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an isolated Jest (JSDOM) test harness for the Scheduler AppointmentPopup, allowing the popup + form to be instantiated and asserted without creating a full Scheduler instance.

Changes:

  • Added a new appointment_popup.test.ts suite that validates basic popup rendering, form binding, and Save/Cancel behavior.
  • Introduced a dedicated createAppointmentPopup test helper and centralized cleanup via disposeAppointmentPopups.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
packages/devextreme/js/__internal/scheduler/tests/appointment_popup.test.ts New isolated AppointmentPopup tests covering rendering, data binding, and Save/Cancel actions.
packages/devextreme/js/__internal/scheduler/tests/mock/create_appointment_popup.ts New helper to construct an AppointmentPopup + AppointmentForm with minimal scheduler proxies and deterministic cleanup.


describe('Isolated AppointmentPopup environment', () => {
beforeEach(() => {
fx.off = true;
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider calling setupSchedulerTestEnvironment() (or at least stubbing DOMComponent.prototype._isVisible) in beforeEach. Most other Scheduler jsdom tests do this to avoid :visible returning false in JSDOM, which can make overlay/popup rendering and visibility-dependent logic flaky.

Suggested change
fx.off = true;
fx.off = true;
setupSchedulerTestEnvironment();

Copilot uses AI. Check for mistakes.
Comment on lines +60 to +69
interface CreateAppointmentPopupOptions {
appointmentData?: Record<string, unknown>;
action?: number;
editing?: Record<string, unknown>;
firstDayOfWeek?: number;
startDayHour?: number;
onAppointmentFormOpening?: (...args: unknown[]) => void;
addAppointment?: jest.Mock;
updateAppointment?: jest.Mock;
}
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The option types here are very generic (Record<string, unknown>, number), which reduces the value of these helpers and can hide breaking changes in the popup contract. Consider typing appointmentData as Partial<SafeAppointment> (or similar) and action as a union of ACTION_TO_APPOINTMENT values, and tightening editing to the scheduler editing config shape used by AppointmentPopup/AppointmentForm.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants