Skip to content

Conversation

@aleksei-semikozov
Copy link
Contributor

No description provided.

@aleksei-semikozov aleksei-semikozov self-assigned this Feb 11, 2026
@aleksei-semikozov aleksei-semikozov requested a review from a team as a code owner February 11, 2026 08:49
Copilot AI review requested due to automatic review settings February 11, 2026 08:49
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

This PR adds Testing Library dependencies to the devextreme package and refactors Scheduler internal Jest test page-object models to use Testing Library (within + role-based queries) instead of direct CSS selectors.

Changes:

  • Add @testing-library/dom, @testing-library/jest-dom, and @testing-library/user-event to packages/devextreme devDependencies (and update pnpm-lock.yaml).
  • Update Scheduler test POM models (SchedulerModel, ToolbarModel, PopupModel) to use within(...) and role-based queries for key elements.
  • Adjust POM typing/lookup logic around appointments and toolbar elements.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
pnpm-lock.yaml Adds lockfile entries for Testing Library packages.
packages/devextreme/package.json Introduces Testing Library packages under devDependencies.
packages/devextreme/js/__internal/scheduler/__tests__/__mock__/model/toolbar.ts Switches navigator button lookup to Testing Library role/name queries.
packages/devextreme/js/__internal/scheduler/__tests__/__mock__/model/scheduler.ts Adds within(container) queries and refactors appointment/toolbar accessors.
packages/devextreme/js/__internal/scheduler/__tests__/__mock__/model/popup.ts Uses Testing Library role/name queries for popup action buttons.
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

Comment on lines +87 to +89
"@testing-library/dom": "^10.4.0",
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/user-event": "^14.5.2",
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

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

The newly added Testing Library entries use caret ranges, while the rest of this package’s devDependencies are pinned to exact versions (or catalog:). To keep dependency resolution deterministic and consistent with existing conventions, please pin these to exact versions (and regenerate the lockfile accordingly).

Copilot uses AI. Check for mistakes.
Comment on lines +13 to 19
getPrevButton(): HTMLElement {
return this.queries.getByRole('button', { name: 'Previous page' }) as HTMLElement;
}

getNextButton(): HTMLDivElement | null | undefined {
return this.element?.querySelector('.dx-scheduler-navigator-next');
getNextButton(): HTMLElement {
return this.queries.getByRole('button', { name: 'Next page' }) as HTMLElement;
}
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

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

getPrevButton/getNextButton hardcode English accessible names ('Previous page'/'Next page'). Since the actual aria-label is produced via localization (dxScheduler-navigationPrevious/dxScheduler-navigationNext in header/m_date_navigator.ts), this makes the test model brittle if message text or locale changes. Consider deriving the expected name via messageLocalization.format(...) (or reusing those keys/constants) instead of hardcoding the English strings.

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants