Repository navigation
feat(eui): pass data-test-subj to date picker elements - #9042
Merged
weronikaolejniczak merged 8 commits intoSep 23, 2025
Merged
weronikaolejniczak merged 8 commits into
weronikaolejniczak merged 8 commits into
Conversation
weronikaolejniczak
force-pushed
the
feat/eui-date-picker-data-test-subj
branch
2 times, most recently
from
September 19, 2025 12:21
c3efc7f to
29868cc
Compare
weronikaolejniczak
marked this pull request as ready for review
September 19, 2025 12:22
acstll
self-requested a review
September 22, 2025 10:35
weronikaolejniczak
marked this pull request as draft
September 22, 2025 12:26
weronikaolejniczak
marked this pull request as ready for review
September 22, 2025 12:34
weronikaolejniczak
force-pushed
the
feat/eui-date-picker-data-test-subj
branch
from
September 22, 2025 12:37
ee87f24 to
26b7e0b
Compare
weronikaolejniczak
force-pushed
the
feat/eui-date-picker-data-test-subj
branch
from
September 22, 2025 12:37
26b7e0b to
9008503
Compare
weronikaolejniczak
marked this pull request as draft
September 22, 2025 13:06
weronikaolejniczak
marked this pull request as ready for review
September 22, 2025 15:15
acstll
requested changes
Sep 23, 2025
acstll
left a comment
Contributor
There was a problem hiding this comment.
Thank you @weronikaolejniczak for taking this one. I tested in Storybook and it's working as expected. The tests make sense.
The one thing I had doubts with was the casing of the nested names. I had imagine something BEM-like, like ${dataTestSubj}__input-container or even ${dataTestSubj}__inputContainer, but I found there's no consistency in the codebase with similar cases, so I actually find the one you went with (kebab) is appropriate. Did you consider other options?
Mostly nits in the comments.
Co-authored-by: Arturo Castillo Delgado <[email protected]>
Contributor
Author
|
@acstll thanks for the review! 💚 I applied your suggestions, they are very useful, thanks! |
acstll
reviewed
Sep 23, 2025
acstll
approved these changes
Sep 23, 2025
acstll
left a comment
Contributor
There was a problem hiding this comment.
🟢 Thanks for the updates, and again for picking this one up.
Collaborator
💚 Build SucceededHistory
|
Collaborator
💚 Build Succeeded
History
|
acstll
added a commit
to elastic/kibana
that referenced
this pull request
Oct 9, 2025
- `@elastic/eui`: `v106.6.0` ⏩ `v106.7.0` - `@elastic/eui-theme-borealis`: `v3.4.0` ⏩ `v3.5.0` [Questions? Please see our Kibana upgrade FAQ.](https://github.com/elastic/eui/blob/main/wiki/eui-team-processes/upgrading-kibana.md#faq-for-kibana-teams) --- ## Changes - replaced usages of `EuiButtonEmpty` in Discover `change_dataview` and `EuiFilterButton` in Dashboard `options_list_control `with the newly added `EuiFormControlButton` component to ensure cohesive form layout styling (EUI [#9006](elastic/eui#9006)) **Discover** | before | after | |---|---| | <img width="434" height="369" alt="Screenshot 2025-10-07 at 22 13 23" src="https://github.com/user-attachments/assets/488984a0-a6a1-488e-8db5-588c84be6765" /> | <img width="418" height="365" alt="Screenshot 2025-10-07 at 22 20 16" src="https://github.com/user-attachments/assets/16164d3f-0b8d-4ceb-a971-a10a6d1f5aee" /> | | <img width="432" height="371" alt="Screenshot 2025-10-07 at 22 12 39" src="https://github.com/user-attachments/assets/37fd32f5-6d15-459d-9e14-776a671b7fd6" /> | <img width="423" height="372" alt="Screenshot 2025-10-07 at 22 21 16" src="https://github.com/user-attachments/assets/846eb3f6-7d39-4c6e-9e22-42b694f9a276" /> | **Dashboard** | before | after | |---|---| | <img width="475" height="288" alt="Screenshot 2025-10-07 at 22 13 13" src="https://github.com/user-attachments/assets/4ff88734-18d7-456a-991d-ba491550a4dd" /> | <img width="432" height="292" alt="Screenshot 2025-10-07 at 17 44 25" src="https://github.com/user-attachments/assets/6e97337f-11e6-4213-a80b-5424dcb3ee38" /> | | <img width="475" height="289" alt="Screenshot 2025-10-07 at 22 12 51" src="https://github.com/user-attachments/assets/dcbd1470-8bdd-453a-8fc0-20da26bc3e27" /> | <img width="471" height="288" alt="Screenshot 2025-10-07 at 21 44 36" src="https://github.com/user-attachments/assets/7f2c5b10-44cf-4efc-a902-dd72889b3043" /> | ## Package updates ## [`v106.7.0`](https://github.com/elastic/eui/releases/v106.7.0) - Updated `EuiComboBox` to properly break long strings without spaces when `rowHeight="auto"` ([#9063](elastic/eui#9063)) - Added `data-test-subj` support to `EuiDatePicker` and `EuiDatePickerRange` for improved testability. Propagates to main component wrappers, inputs, clear buttons, calendar navigation, and popover panels. ([#9042](elastic/eui#9042)) - Added `streamsClassic` and `streamsWired` icons ([#9017](elastic/eui#9017)) - Updated icons based on feedback: `boxesVertical`, `documentation`, `error`, `export`, `filter`, `filterExclude`, `filterIgnore`, `filterInclude`, `grab`, `grabOmnidirectional`, `grabHorizontal`, `importAction`, `indexTemporary`, `link`, `list`, `magnifyWithExclamation`, `magnifyWithMinus`, `magnifyWithPlus`, `minus`, `minusInCircle`, `pencil`, `pin`, `pinFilled`, `plus`, `plusInCircle`, `question`, `search`, `sortLeft`, `sortRight`, `sortDown`, `sortUp`, `sortable`, `unlink`. ([#9026](elastic/eui#9026)) - Added new icon: `backgroundTask`. ([#9026](elastic/eui#9026)) - Marked icons for deprecation: `boxesHorizontal`, `checkInCircleFilled`, `copyClipboard`, `documentEdit`, `errorFilled`, `expandMini`, `filterInCircle`, `lettering`, `listAdd`, `minusInCircleFilled`, `newChat`, `playFilled`, `plusInCircleFilled`, `submodule`, `tableDensityNormal`, `warningFilled`. ([#9026](elastic/eui#9026)) - Added `workflowsApp` icon ([#9011](elastic/eui#9011)) - Added `EuiFormControlButton` component for usage as input-styled button within `EuiFormControlLayout` ([#9006](elastic/eui#9006)) - Updated `EuiSuperDatePicker` to use `EuiFormControlButton` when a prettified duration button is rendered ([#9006](elastic/eui#9006)) **Bug fixes** - Fixed `EuiInMemoryTable` not firing the `search.onChange` callback when `searchFormat` equals `text`. ([#9059](elastic/eui#9059)) - Fixed `columns` in `EuiDataGrid` not being rendered in the correct order as defined by `columnVisibility.visibleColumns` which resulted in unexpected updates when reordering columns ([#9030](elastic/eui#9030)) **Accessibility** - Improved color contrast of non-interactive `EuiBreadcrumbs` items in dark mode ([#9071](elastic/eui#9071)) - Make `EuiProgress` respect user's reduced motion setting by not animating when in indeterminite state. ([#9054](elastic/eui#9054)) ### `@elastic/eui-theme-borealis` ## [`v3.5.0`](https://github.com/elastic/eui/blob/main/packages/eui-theme-borealis/changelogs/CHANGELOG_2025.md#v350) - Updated color value of `textSubdued` and legacy `subduedText` in dark mode from `#8E9FBC` to `#98A8C3` ([#9071](elastic/eui#9071)) **Bug fixes** - Fixed values of `$euiFormBackground` and `$euiFormBackgroundReadOnlyColor` to match JS tokens ([#9067](elastic/eui#9067)) --------- Co-authored-by: Elastic Machine <[email protected]> Co-authored-by: Lene Gadewoll <[email protected]>
tsullivan
pushed a commit
that referenced
this pull request
Oct 15, 2025
Co-authored-by: Arturo Castillo Delgado <[email protected]>
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.
Summary
Resolves #9020
Added
data-test-subjsupport toEuiDatePickerandEuiDatePickerRangeand all their essential elements.Changes
data-test-subjprop that propagates to the main wrapper, input field, calendar popover, navigation buttons and clear button.data-test-subjprop that creates wrapper elements with test subjects for start/end date controls (*-start-date,*-end-date).react-datepickerfork to support test subjects on calendar elements, navigation buttons (*-prev-month,*-next-month) and popover containers.Patterns
EuiDatePicker(story)data-test-subj="my-date-picker"data-test-subj="my-date-picker-input-container"data-test-subj="my-date-picker-input"data-test-subj="my-date-picker-clear"data-test-subj="my-date-picker-popover"data-test-subj="my-date-picker-calendar-prev-month"data-test-subj="my-date-picker-calendar-next-month"Screenshots
EuiDatePickerRange(story)data-test-subj="my-date-range-picker"data-test-subj="my-date-range-picker-range-wrapper"(requested)data-test-subj="my-date-range-picker-start-date-input-container"data-test-subj="my-date-range-picker-start-date-input"(requested)data-test-subj="my-date-range-picker-end-date-input-container"data-test-subj="my-date-range-picker-end-date-input"(requested)data-test-subj="my-date-range-picker-start-date-popover"data-test-subj="my-date-range-picker-start-date-calendar-prev-month"data-test-subj="my-date-range-picker-start-date-calendar-next-month"Why are we making this change?
It was raised as an internal request by a Kibana developer. They want to implement analytics tracking but the
ReactDatePickerisn't applying the passeddata-test-subjinEuiDatePicker.They mentioned they need to query 3 elements for the tracking:
data-test-subj="my-date-range-picker-range-wrapper"),data-test-subj="my-date-range-picker-start-date-input"),data-test-subj="my-date-range-picker-end-date-input").Impact to users
🟢 No impact to users. This is purely a change for testing / tracking purposes. No visual or behavioral changes.
QA
Tip
I added a
data-test-subjto date picker stories for easier testing.Specific checklist
EuiDatePickerEuiDatePickerRangeyarn workspace @elastic/eui test-visual-regressiondata-test-subjpropagates to all essential elements in:EuiDatePickerEuiDatePickerRangeGeneral checklist
@defaultif default values are missing) and playground toggles