From 63662a434e138ee81468cd93e24b7e88835e47e4 Mon Sep 17 00:00:00 2001 From: Constance Chen Date: Tue, 20 Sep 2022 13:04:34 -0700 Subject: [PATCH 1/7] [setup] Add missing tooltip helper type defs --- src/test/rtl/component_helpers.d.ts | 3 +++ 1 file changed, 3 insertions(+) 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; From 3035f528c7cd58c05d1f8e83febe98b7fb57ac50 Mon Sep 17 00:00:00 2001 From: Constance Chen Date: Tue, 20 Sep 2022 13:07:20 -0700 Subject: [PATCH 2/7] Update `shouldRenderCustomStyles` with a `renderCallback` option - for components (primarily tooltip) that only render the component conditionally - nb: snapshot changed because the preceding test removes a className from `body` --- .../__snapshots__/tool_tip.test.tsx.snap | 4 +++- src/components/tool_tip/tool_tip.test.tsx | 14 ++++++++++++++ src/test/internal/render_custom_styles.tsx | 17 ++++++++++------- 3 files changed, 27 insertions(+), 8 deletions(-) diff --git a/src/components/tool_tip/__snapshots__/tool_tip.test.tsx.snap b/src/components/tool_tip/__snapshots__/tool_tip.test.tsx.snap index 923b18ec8f7..4d17225945c 100644 --- a/src/components/tool_tip/__snapshots__/tool_tip.test.tsx.snap +++ b/src/components/tool_tip/__snapshots__/tool_tip.test.tsx.snap @@ -30,7 +30,9 @@ exports[`EuiToolTip display prop renders block 1`] = ` `; exports[`EuiToolTip is rendered 1`] = ` - +
{ + shouldRenderCustomStyles( + +