-
Notifications
You must be signed in to change notification settings - Fork 665
Scheduler - Appointment Form - Fix KBN issues #32225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 11 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
23f4757
fix issue 2 & 3: kbn in recurrence form
Tucchhaa 9a9adcc
fix issue 4: select box looses focus
Tucchhaa 20d4e5c
fix lint
Tucchhaa d6d6627
fix lint & jest
Tucchhaa 5c0fad2
update etalons
Tucchhaa 4508f6f
fix tests
Tucchhaa f43d6b9
css: fix recurrence button settings focus styling
sjbur 8b6da60
test: add test for recurrence settings button focus state
sjbur 832bb6f
feat: add tests for focus of subject editor and recurrency start date…
sjbur b538a5e
test: move recurrence settings button test and add etalons
sjbur b704ae9
test: add tests for FrequencyEditor
sjbur aacfa87
test: remove unfocused recurrence settings button test
sjbur e241377
test: move recurrence settings button focus state test
sjbur 4b0cbea
test: enhance focus navigation for recurrence settings button
sjbur 249c87a
test: update etalons
sjbur d2c2ba7
css: replace background color in focus state with outline
sjbur 61e4449
test: move testcafe tests to jest
sjbur e81e406
feat: update etalons
sjbur 287dd19
small improvements
Tucchhaa bf70cd0
move tests to a common file
Tucchhaa 68ce4eb
update etalon
Tucchhaa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file modified
BIN
-68 Bytes
(100%)
.../etalons/scheduler__appointment__recurrence-form__daily (fluent.blue.light).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-67 Bytes
(100%)
...etalons/scheduler__appointment__recurrence-form__hourly (fluent.blue.light).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-87 Bytes
(100%)
...etalons/scheduler__appointment__recurrence-form__mobile (fluent.blue.light).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-68 Bytes
(100%)
...talons/scheduler__appointment__recurrence-form__monthly (fluent.blue.light).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+53 Bytes
(100%)
...alons/scheduler__appointment__recurrence-form__readonly (fluent.blue.light).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-70 Bytes
(100%)
...etalons/scheduler__appointment__recurrence-form__weekly (fluent.blue.light).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-86 Bytes
(100%)
...ons/scheduler__appointment__recurrence-form__with-icons (fluent.blue.light).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-67 Bytes
(100%)
...etalons/scheduler__appointment__recurrence-form__yearly (fluent.blue.light).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+27.5 KB
...r__appointment__recurrence-settings-button__focus-state (fluent.blue.light).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+27.4 KB
...r__appointment__recurrence-settings-button__not-focused (fluent.blue.light).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 36 additions & 0 deletions
36
e2e/testcafe-devextreme/tests/scheduler/common/appointmentForm/form.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| import Scheduler from 'devextreme-testcafe-models/scheduler'; | ||
| import { createWidget } from '../../../../helpers/createWidget'; | ||
| import url from '../../../../helpers/getPageUrl'; | ||
|
|
||
| fixture.disablePageReloads`Appointment Form: Recurrence Form` | ||
| .page(url(__dirname, '../../../container.html')); | ||
|
|
||
| const SCHEDULER_SELECTOR = '#container'; | ||
|
|
||
| test('Subject text editor should have focus after returning from recurrence form', async (t) => { | ||
| const appointment = { | ||
| text: 'Appointment', | ||
| startDate: new Date('2021-04-26T16:30:00.000Z'), | ||
| endDate: new Date('2021-04-26T18:30:00.000Z'), | ||
| allDay: false, | ||
| recurrenceRule: 'FREQ=WEEKLY;BYDAY=MO,TH;COUNT=10', | ||
| }; | ||
|
|
||
| const scheduler = new Scheduler(SCHEDULER_SELECTOR); | ||
| const appointmentPopup = await scheduler.openAppointmentPopup(t, appointment, true); | ||
|
|
||
| await appointmentPopup.openRecurrenceSettings(t); | ||
|
|
||
| await t.click(appointmentPopup.recurrence.backButton); | ||
|
|
||
| await t | ||
| .expect(appointmentPopup.textEditor.getInput().focused) | ||
| .ok(); | ||
| }).before(async () => { | ||
| await createWidget('dxScheduler', { | ||
| dataSource: [], | ||
| views: ['week'], | ||
| currentView: 'week', | ||
| currentDate: new Date(2021, 2, 25), | ||
| }); | ||
| }); |
142 changes: 142 additions & 0 deletions
142
e2e/testcafe-devextreme/tests/scheduler/common/appointmentForm/recurrence-form.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,142 @@ | ||
| import { ClientFunction, Selector } from 'testcafe'; | ||
| import Scheduler from 'devextreme-testcafe-models/scheduler'; | ||
| import { SELECTORS } from 'devextreme-testcafe-models/scheduler/appointment/popup'; | ||
| import SelectBox from 'devextreme-testcafe-models/selectBox'; | ||
| import { createWidget } from '../../../../helpers/createWidget'; | ||
| import url from '../../../../helpers/getPageUrl'; | ||
|
|
||
| fixture.disablePageReloads`Appointment Form: Recurrence Form` | ||
| .page(url(__dirname, '../../../container.html')); | ||
|
|
||
| const SCHEDULER_SELECTOR = '#container'; | ||
|
|
||
| test('Recurrence start date editor should have focus after opening recurrence settings', async (t) => { | ||
| const appointment = { | ||
| text: 'Appointment', | ||
| startDate: new Date('2021-04-26T16:30:00.000Z'), | ||
| endDate: new Date('2021-04-26T18:30:00.000Z'), | ||
| allDay: false, | ||
| recurrenceRule: 'FREQ=WEEKLY;BYDAY=MO,TH;COUNT=10', | ||
| }; | ||
|
|
||
| const scheduler = new Scheduler(SCHEDULER_SELECTOR); | ||
| const appointmentPopup = await scheduler.openAppointmentPopup(t, appointment, true); | ||
|
|
||
| await appointmentPopup.openRecurrenceSettings(t); | ||
|
|
||
| await t | ||
| .expect(appointmentPopup.recurrence.startDateInput.focused) | ||
| .ok(); | ||
| }).before(async () => { | ||
| await createWidget('dxScheduler', { | ||
| dataSource: [], | ||
| views: ['week'], | ||
| currentView: 'week', | ||
| currentDate: new Date(2021, 2, 25), | ||
| }); | ||
| }); | ||
|
|
||
| test('FrequencyEditor should not be focused when value is changed via API', async (t) => { | ||
| const appointment = { | ||
| text: 'Appointment', | ||
| startDate: new Date('2021-04-26T16:30:00.000Z'), | ||
| endDate: new Date('2021-04-26T18:30:00.000Z'), | ||
| allDay: false, | ||
| recurrenceRule: 'FREQ=WEEKLY;BYDAY=MO,TH;COUNT=10', | ||
| }; | ||
|
|
||
| const scheduler = new Scheduler(SCHEDULER_SELECTOR); | ||
| const appointmentPopup = await scheduler.openAppointmentPopup(t, appointment, true); | ||
|
|
||
| await appointmentPopup.openRecurrenceSettings(t); | ||
|
|
||
| const frequencyEditor = new SelectBox(Selector(SELECTORS.recurrenceFrequencyEditor)); | ||
| const { getInstance } = frequencyEditor; | ||
|
|
||
| const changeFrequencyValue = ClientFunction( | ||
| () => { | ||
| const instance = getInstance(); | ||
| if (instance) { | ||
| (instance as any).option('value', 'yearly'); | ||
| } | ||
| }, | ||
| { dependencies: { getInstance } }, | ||
| ); | ||
|
|
||
| await changeFrequencyValue(); | ||
|
|
||
| await t | ||
| .expect(frequencyEditor.getInput().focused) | ||
| .notOk(); | ||
| }).before(async () => { | ||
| await createWidget('dxScheduler', { | ||
| dataSource: [], | ||
| views: ['week'], | ||
| currentView: 'week', | ||
| currentDate: new Date(2021, 2, 25), | ||
| }); | ||
| }); | ||
|
|
||
| test('FrequencyEditor should be focused when value is changed via mouse', async (t) => { | ||
| const appointment = { | ||
| text: 'Appointment', | ||
| startDate: new Date('2021-04-26T16:30:00.000Z'), | ||
| endDate: new Date('2021-04-26T18:30:00.000Z'), | ||
| allDay: false, | ||
| recurrenceRule: 'FREQ=WEEKLY;BYDAY=MO,TH;COUNT=10', | ||
| }; | ||
|
|
||
| const scheduler = new Scheduler(SCHEDULER_SELECTOR); | ||
| const appointmentPopup = await scheduler.openAppointmentPopup(t, appointment, true); | ||
|
|
||
| await appointmentPopup.openRecurrenceSettings(t); | ||
|
|
||
| const frequencyEditor = new SelectBox(Selector(SELECTORS.recurrenceFrequencyEditor)); | ||
| await t.click(frequencyEditor.element); | ||
|
|
||
| const yearlyOption = Selector(SELECTORS.listOption).withText('Year(s)'); | ||
| await t.click(yearlyOption); | ||
|
|
||
| await t | ||
| .expect(frequencyEditor.getInput().focused) | ||
| .ok(); | ||
| }).before(async () => { | ||
| await createWidget('dxScheduler', { | ||
| dataSource: [], | ||
| views: ['week'], | ||
| currentView: 'week', | ||
| currentDate: new Date(2021, 2, 25), | ||
| }); | ||
| }); | ||
|
|
||
| test('FrequencyEditor should be focused when value is changed via keyboard', async (t) => { | ||
| const appointment = { | ||
| text: 'Appointment', | ||
| startDate: new Date('2021-04-26T16:30:00.000Z'), | ||
| endDate: new Date('2021-04-26T18:30:00.000Z'), | ||
| allDay: false, | ||
| recurrenceRule: 'FREQ=WEEKLY;BYDAY=MO,TH;COUNT=10', | ||
| }; | ||
|
|
||
| const scheduler = new Scheduler(SCHEDULER_SELECTOR); | ||
| const appointmentPopup = await scheduler.openAppointmentPopup(t, appointment, true); | ||
|
|
||
| await appointmentPopup.openRecurrenceSettings(t); | ||
|
|
||
| const frequencyEditor = new SelectBox(Selector(SELECTORS.recurrenceFrequencyEditor)); | ||
|
|
||
| await t.doubleClick(frequencyEditor.element); | ||
|
|
||
| await t.pressKey('down'); | ||
|
|
||
| await t | ||
| .expect(frequencyEditor.getInput().focused) | ||
| .ok(); | ||
| }).before(async () => { | ||
| await createWidget('dxScheduler', { | ||
| dataSource: [], | ||
| views: ['week'], | ||
| currentView: 'week', | ||
| currentDate: new Date(2021, 2, 25), | ||
| }); | ||
| }); | ||
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.