) => void;
} = {}
) => {
const testCases = options.skipStyles
@@ -71,25 +72,27 @@ export const shouldRenderCustomStyles = (
// Some tests run separate child props tests with different settings & don't need
// to run the base parent test multiple times. If so, allow skipping this test
if (!(options.skipParentTest === true && options.childProps)) {
- it(`should render custom ${testCases}`, () => {
- const { baseElement } = render(
+ it(`should render custom ${testCases}`, async () => {
+ const result = render(
{React.cloneElement(component, testProps)}
);
- assertOutputStyles(baseElement, options);
+ await options.renderCallback?.(result);
+ assertOutputStyles(result.baseElement, options);
});
}
if (options.childProps) {
options.childProps.forEach((childProps) => {
- it(`should render custom ${testCases} on ${childProps}`, () => {
+ it(`should render custom ${testCases} on ${childProps}`, async () => {
const mergedChildProps = set({ ...component.props }, childProps, {
...get(component.props, childProps),
...testProps,
});
- const { baseElement } = render(
+ const result = render(
{React.cloneElement(component, mergedChildProps)}
);
- assertOutputStyles(baseElement, options);
+ await options.renderCallback?.(result);
+ assertOutputStyles(result.baseElement, options);
});
});
}
diff --git a/src/test/rtl/component_helpers.d.ts b/src/test/rtl/component_helpers.d.ts
index c3aae9ea823..678cf0ba3dc 100644
--- a/src/test/rtl/component_helpers.d.ts
+++ b/src/test/rtl/component_helpers.d.ts
@@ -5,3 +5,6 @@
*/
export declare const waitForEuiPopoverOpen: () => Promise;
export declare const waitForEuiPopoverClose: () => Promise;
+
+export declare const waitForEuiToolTipVisible: () => Promise;
+export declare const waitForEuiToolTipHidden: () => Promise;
diff --git a/src/test/rtl/component_helpers.ts b/src/test/rtl/component_helpers.ts
index 129a0a392bb..656477f8d4d 100644
--- a/src/test/rtl/component_helpers.ts
+++ b/src/test/rtl/component_helpers.ts
@@ -30,10 +30,13 @@ export const waitForEuiPopoverClose = async () =>
* Ensure the EuiToolTip being tested is open and visible before continuing
*/
export const waitForEuiToolTipVisible = async () =>
- await waitFor(() => {
- const tooltip = document.querySelector('.euiToolTipPopover');
- expect(tooltip).toBeVisible();
- });
+ await waitFor(
+ () => {
+ const tooltip = document.querySelector('.euiToolTipPopover');
+ expect(tooltip).toBeVisible();
+ },
+ { timeout: 1500 } // Account for long delay on tooltips
+ );
export const waitForEuiToolTipHidden = async () =>
await waitFor(() => {
diff --git a/upcoming_changelogs/6253.md b/upcoming_changelogs/6253.md
new file mode 100644
index 00000000000..a7ef95174eb
--- /dev/null
+++ b/upcoming_changelogs/6253.md
@@ -0,0 +1,3 @@
+**Bug fixes**
+
+- Fixed `EuiSuperDatePicker` not correctly merging passed `className`s