Skip to content

Conversation

@Tucchhaa
Copy link
Contributor

No description provided.

@Tucchhaa Tucchhaa self-assigned this Jan 16, 2026
@Tucchhaa Tucchhaa added the 26_1 label Jan 16, 2026
private createRecurrenceRuleGroup(): GroupItem {
// Change of frequency editor's value causes rerender of the recurrencePatternGroup.
// To prevent focus loss in this editor, we use this flag.
let needRestoreFrequencyEditorFocus = false;
Copy link
Contributor Author

@Tucchhaa Tucchhaa Jan 16, 2026

Choose a reason for hiding this comment

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

The reason of focus loss is because recurrencePatternGroup group gets rerendered when updateDayEditorsVisibility() is called.

Another solution is to wrap weekGroup, monthGroup and yearGroup into different group here.

I have decided to use this flag, because it's used in very narrow scope and because form items already have very deep nesting (docs).

But if you have any objections, let's discuss it :)

Comment on lines 163 to 168
await testScreenshot(
t,
takeScreenshot,
'scheduler__appointment__recurrence-settings-button__not-focused.png',
{ element: appointmentPopup.contentElement },
);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think, there's no need to screenshot the form before focusing settings button, because there are already visual tests for form that do that.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, it makes sense

Copy link
Contributor

Choose a reason for hiding this comment

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

Done

},
}));

test.meta({ browserSize: [1500, 1500] })('Recurrence settings button should have correct focus state', async (t) => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I suggest to move this test to form.visual.ts file, because it takes screenshot of main form, not recurrence form

Copy link
Contributor

Choose a reason for hiding this comment

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

OK

Copy link
Contributor

Choose a reason for hiding this comment

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

Done

{ element: appointmentPopup.contentElement },
);

await t.hover(appointmentPopup.recurrence.settingsButton);
Copy link
Contributor Author

@Tucchhaa Tucchhaa Jan 19, 2026

Choose a reason for hiding this comment

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

It's better to focus the button using keyboard navigation, because hovering the button doesn't set it to 'focused' state.

Copy link
Contributor

Choose a reason for hiding this comment

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

OK, will replace with await t.pressKey('tab')

Copy link
Contributor

Choose a reason for hiding this comment

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

Done

});
});

test('FrequencyEditor should not be focused when value is changed via API', async (t) => {
Copy link
Contributor Author

@Tucchhaa Tucchhaa Jan 19, 2026

Choose a reason for hiding this comment

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

Can we move frequency editor tests to jest? It seems that they are purely functional. We can simulate keyboard or mouse by emitting native event. Also I think that maybe we only need keyboard tests, because both mouse and keyboard emit native events. So to me it seems that we just need one of these tests.

What do you think?

Copy link
Contributor

Choose a reason for hiding this comment

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

Seems legit

Copy link
Contributor

Choose a reason for hiding this comment

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

Done


const SCHEDULER_SELECTOR = '#container';

test('Subject text editor should have focus after returning from recurrence form', async (t) => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think we need to place tests to move from main form to recurrence form and vice versa into a single file, since these tests are related. Maybe just have create one file for form functional testcafe tests? Like form.functional.ts?

Copy link
Contributor

@sjbur sjbur Jan 19, 2026

Choose a reason for hiding this comment

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

And if we will have new testcafe functional tests in the future? We assume that the amount of functional tests will be so low that it will not be a problem?

Comment on lines 749 to 752
&.dx-button-mode-text.dx-state-focused,
&.dx-button-mode-text.dx-state-hover {
background-color: rgba(0, 0, 0, .08);
}
Copy link
Contributor Author

@Tucchhaa Tucchhaa Jan 19, 2026

Choose a reason for hiding this comment

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

The problem with this approach is that if background-color of dxButton is changed (for example, the designer decided to change it or new color scheme is added, or a user customizes button background color), then the background-color of settings button will not have the same background-color and we will need to change this value too.

Please address this issue. Possible solutions:

  1. set dx-state-press class to button when the button is focused
  2. set outline to the button when it's focused

Copy link
Contributor

Choose a reason for hiding this comment

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

Wrote directly to you in Teams about this

Copy link
Contributor

Choose a reason for hiding this comment

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

Added default outline styling like in another parts of project

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