-
Notifications
You must be signed in to change notification settings - Fork 859
[Storybook][VRT] Render all portalled elements in Storybook's root #8003
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 all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
81868fc
Fix EuiPopover not correctly inheriting `componentDefaults.EuiPortal.…
cee-chen 71585d2
[misc] fix typescript complaints in Cypress files
cee-chen 74f3bd5
Update Storybook default decorator to append all portals into the `#s…
cee-chen acb814b
[EuiComboBox] Update loki selector
cee-chen f339334
[EuiHeader] Update loki selector
cee-chen d33d932
[EuiHeaderLinks] Use `play` instead of forcing popover to be open
cee-chen 31b2123
[EuiAutoRefresh] Address `play()` todo
cee-chen 748064d
[EuiSuperDatePicker] Address `play` todo
cee-chen 893927a
[EuiDatePicker] Address `play` todo
cee-chen 9df1ada
[PR feedback] Address failing EuiHeaderLinks desktop `play()`
cee-chen 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
+21 Bytes
(100%)
...ference/chrome_desktop_Forms_EuiAutoRefresh_EuiAutoRefreshButton_Playground.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
+6.08 KB
(310%)
...oki/reference/chrome_desktop_Forms_EuiAutoRefresh_EuiAutoRefresh_Playground.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
-682 Bytes
(95%)
packages/eui/.loki/reference/chrome_desktop_Forms_EuiComboBox_Groups.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
-682 Bytes
(95%)
.../eui/.loki/reference/chrome_desktop_Forms_EuiComboBox_Nested_Options_Groups.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
-1.33 KB
(94%)
packages/eui/.loki/reference/chrome_desktop_Forms_EuiDatePicker_Playground.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
+20 Bytes
(100%)
...ui/.loki/reference/chrome_desktop_Forms_EuiDatePicker_Restricted_Day_Select.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
-7 Bytes
(100%)
packages/eui/.loki/reference/chrome_desktop_Forms_EuiDatePicker_Time_Select.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
-4 Bytes
(100%)
...ges/eui/.loki/reference/chrome_desktop_Forms_EuiDatePicker_Time_Select_Only.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
+17.4 KB
(510%)
...sktop_Forms_EuiSuperDatePicker_EuiSuperDatePicker_Custom_Quick_Select_Panel.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
+47 Bytes
(100%)
...rence/chrome_desktop_Forms_EuiSuperDatePicker_EuiSuperDatePicker_Playground.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
-272 Bytes
(93%)
...i/.loki/reference/chrome_desktop_Layout_EuiHeader_EuiHeaderLinks_Playground.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
+0 Bytes
(100%)
...e/chrome_desktop_Layout_EuiHeader_EuiHeader_Dark_Theme_With_Sitewide_Search.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
+57 Bytes
(100%)
...eference/chrome_mobile_Forms_EuiAutoRefresh_EuiAutoRefreshButton_Playground.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
+11.9 KB
(290%)
...loki/reference/chrome_mobile_Forms_EuiAutoRefresh_EuiAutoRefresh_Playground.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
-352 Bytes
(99%)
packages/eui/.loki/reference/chrome_mobile_Forms_EuiComboBox_Groups.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
-352 Bytes
(99%)
...s/eui/.loki/reference/chrome_mobile_Forms_EuiComboBox_Nested_Options_Groups.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%)
packages/eui/.loki/reference/chrome_mobile_Forms_EuiDatePicker_Playground.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
+42 Bytes
(100%)
...eui/.loki/reference/chrome_mobile_Forms_EuiDatePicker_Restricted_Day_Select.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
+57 Bytes
(100%)
packages/eui/.loki/reference/chrome_mobile_Forms_EuiDatePicker_Time_Select.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%)
...ages/eui/.loki/reference/chrome_mobile_Forms_EuiDatePicker_Time_Select_Only.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
+32.4 KB
(560%)
...obile_Forms_EuiSuperDatePicker_EuiSuperDatePicker_Custom_Quick_Select_Panel.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
(99%)
...erence/chrome_mobile_Forms_EuiSuperDatePicker_EuiSuperDatePicker_Playground.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
-85 Bytes
(99%)
...ui/.loki/reference/chrome_mobile_Layout_EuiHeader_EuiHeaderLinks_Playground.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| /* | ||
| * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| * or more contributor license agreements. Licensed under the Elastic License | ||
| * 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
| * in compliance with, at your election, the Elastic License 2.0 or the Server | ||
| * Side Public License, v 1. | ||
| */ | ||
|
|
||
| import { queries, within, waitFor, fireEvent, expect } from '@storybook/test'; | ||
| import * as dataTestSubjQueries from '../src/test/rtl/data_test_subj_queries'; | ||
|
|
||
| /** | ||
| * Custom Storybook within util with EUI query helpers | ||
| * + additional chained async/waitFor component utils | ||
| * | ||
| * @see https://storybook.js.org/docs/writing-stories/play-function#writing-stories-with-the-play-function | ||
| * @see https://testing-library.com/docs/dom-testing-library/api-within/ | ||
| */ | ||
| const customWithin = (canvasElement: HTMLElement) => { | ||
| const canvas = within<typeof queries & typeof dataTestSubjQueries>( | ||
| canvasElement, | ||
| { ...queries, ...dataTestSubjQueries } | ||
| ); | ||
|
|
||
| return { | ||
| ...canvas, | ||
|
|
||
| /** | ||
| * 1. Loki doesn't like userEvent, only fireEvent | ||
| * 2. Storybook fires fireEvents too early (esp. on page load), so we add a waitFor | ||
| */ | ||
| waitForAndClick: async (testSubject: string) => { | ||
| await waitFor(() => | ||
| expect(canvas.getByTestSubject(testSubject)).toBeInTheDocument() | ||
| ); | ||
| await fireEvent.click(canvas.getByTestSubject(testSubject)); | ||
| }, | ||
|
|
||
| waitForEuiPopoverVisible: async () => | ||
| await waitFor(() => | ||
| expect(canvasElement.querySelector('[data-popover-open]')).toBeVisible() | ||
| ), | ||
| }; | ||
| }; | ||
|
|
||
| export { customWithin as within }; | ||
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,3 @@ | ||
| **Bug fixes** | ||
|
|
||
| - Fixed `EuiPopover` to correctly inherit from `EuiProvider`'s `componentDefaults.EuiPortal.insert` |
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
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.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the life of me I couldn't get the following components to work correctly with
play()+Loki (they worked great in actual browsers/Storybook however):I tried a variety of events (focus, mouseOver) as well as
userEventwith no success. Posting this because I'm hoping someone else has some ideas that I don't 🫠There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We had noticed that too last time we touched this Loki setup. 🙈
If I remember correctly, somehow for the visual regression it was not actually focussing the browser at the right time.
cc @tkajtoch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sadly still couldn't get this working, so going to go ahead and merge this PR in as-is 🥲