Skip to content

Commit 2a6ce91

Browse files
committed
fix tests
1 parent f899422 commit 2a6ce91

File tree

3 files changed

+21
-11
lines changed

3 files changed

+21
-11
lines changed
Loading

e2e/testcafe-devextreme/tests/scheduler/common/appointmentForm/recurrence-form.visual.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ test.meta({ browserSize: [1500, 1500] })('recurrence form with labelMode=static'
157157
};
158158

159159
const scheduler = new Scheduler(SCHEDULER_SELECTOR);
160-
const appointmentPopup = await scheduler.openAppointmentPopup(t, appointment, false);
160+
const appointmentPopup = await scheduler.openAppointmentPopup(t, appointment, true);
161161

162162
await appointmentPopup.openRecurrenceSettings(t);
163163

packages/devextreme/js/__internal/scheduler/appointment_popup/m_form.ts

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -866,19 +866,29 @@ export class AppointmentForm {
866866
}
867867

868868
private alignIconsWithEditors(): void {
869-
const $groups = this.dxForm.$element().find(`.${CLASSES.groupWithIcon}`);
869+
const groupElements = this.dxForm.element().querySelectorAll(`.${CLASSES.groupWithIcon}`);
870870

871-
$groups.toArray().forEach((groupElement) => {
872-
const $group = $(groupElement);
873-
const $icon = $group.find(`.${CLASSES.formIcon}`);
874-
const $items = $group.find(`.${CLASSES.formItem}:not(:has(.${CLASSES.formIcon}))`);
875-
const $firstSimpleItem = $items.filter(`:not(:has(.${CLASSES.formItem}))`).first();
871+
groupElements.forEach((groupElement) => {
872+
const iconElement = groupElement.querySelector(`.${CLASSES.formIcon}`);
876873

877-
const hasTopLabel = $firstSimpleItem.find(`.${CLASSES.labelTop}`).length > 0;
878-
const hasInnerLabel = $firstSimpleItem.find(`.${CLASSES.label}`).length > 0;
874+
const itemElements = groupElement.querySelectorAll(`.${CLASSES.fieldItemContent}`);
875+
const firstSimpleItemElement = Array.from(itemElements)
876+
.find((itemElement) => {
877+
const isGroup = itemElement.querySelector(`.${CLASSES.formItem}`) !== null;
878+
const isIcon = itemElement.querySelector(`.${CLASSES.formIcon}`) !== null;
879879

880-
$icon.toggleClass(CLASSES.formIconTopLabelOffset, hasTopLabel);
881-
$icon.toggleClass(CLASSES.formIconInnerLabelOffset, hasInnerLabel);
880+
return !isGroup && !isIcon;
881+
});
882+
883+
if (!firstSimpleItemElement || !iconElement) {
884+
return;
885+
}
886+
887+
const hasTopLabel = firstSimpleItemElement.querySelector(`.${CLASSES.labelTop}`) !== null;
888+
const hasInnerLabel = firstSimpleItemElement.querySelector(`.${CLASSES.label}`) !== null;
889+
890+
iconElement.classList.toggle(CLASSES.formIconTopLabelOffset, hasTopLabel);
891+
iconElement.classList.toggle(CLASSES.formIconInnerLabelOffset, hasInnerLabel);
882892
});
883893
}
884894

0 commit comments

Comments
 (0)