Scheduler - Fix TypeScript error in appointment_popup.integration.test#33281
Merged
aleksei-semikozov merged 2 commits intoApr 16, 2026
Merged
Conversation
c0ad594 to
177d595
Compare
sjbur
approved these changes
Apr 15, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes a TypeScript compile error in the Scheduler appointment popup integration test by avoiding direct indexing into a possibly-undefined dxForm.option('items') result.
Changes:
- Replaces a
@ts-expect-errorand directoption('items')[1]access with a null-safe retrieval of form items. - Keeps the recurrence group extraction logic working while satisfying TypeScript’s type checking.
Comment on lines
+1634
to
1636
| const recurrenceGroup = formItems[1] as GroupItem; | ||
| const allItems = flattenBy<SimpleItem>( | ||
| recurrenceGroup.items as SimpleItem[], |
There was a problem hiding this comment.
formItems[1] as GroupItem still relies on a positional index and an unchecked cast. Since the recurrence group has a stable name (recurrenceGroup) in the form items, it would be more robust to locate it by name (e.g., via dxForm.itemOption('recurrenceGroup') or find(i => i.name === 'recurrenceGroup')) and add an explicit assertion if it isn’t found, so failures are clearer than a runtime Cannot read properties of undefined when accessing recurrenceGroup.items.
Suggested change
| const recurrenceGroup = formItems[1] as GroupItem; | |
| const allItems = flattenBy<SimpleItem>( | |
| recurrenceGroup.items as SimpleItem[], | |
| const recurrenceGroup = formItems.find( | |
| (item): item is GroupItem => item.name === 'recurrenceGroup' && 'items' in item, | |
| ); | |
| if (!recurrenceGroup) { | |
| throw new Error('The recurrenceGroup item was not found in the appointment popup form items.'); | |
| } | |
| const allItems = flattenBy<SimpleItem>( | |
| (recurrenceGroup.items ?? []) as SimpleItem[], |
sjbur
pushed a commit
to sjbur/DevExtreme
that referenced
this pull request
May 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.