Skip to content

Commit b601612

Browse files
committed
[EuiToolTip] VRT screenshots
+ fix flakiness via `sleep`
1 parent f9010d3 commit b601612

7 files changed

+30
-1
lines changed
13.8 KB
Loading
11.4 KB
Loading
-125 Bytes
Loading
20.7 KB
Loading
15.9 KB
Loading
-171 Bytes
Loading

packages/eui/src/components/tool_tip/tool_tip.stories.tsx

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ import React from 'react';
1010
import type { Meta, StoryObj } from '@storybook/react';
1111

1212
import { enableFunctionToggleControls } from '../../../.storybook/utils';
13-
import { LOKI_SELECTORS } from '../../../.storybook/loki';
13+
import { LOKI_SELECTORS, lokiPlayDecorator } from '../../../.storybook/loki';
14+
import { sleep } from '../../test';
1415
import { EuiFlexGroup } from '../flex';
1516
import { EuiButton } from '../button';
1617
import { EuiToolTip, EuiToolTipProps } from './tool_tip';
@@ -71,4 +72,32 @@ export const Playground: Story = {
7172
// });
7273
// });
7374
// }),
75+
play: lokiPlayDecorator(async () => {
76+
// Reduce VRT flakiness/screenshots before tooltip is fully visible
77+
await sleep(300);
78+
}),
79+
};
80+
81+
/**
82+
* VRT only stories
83+
*/
84+
85+
export const DarkMode: Story = {
86+
tags: ['vrt-only'],
87+
globals: { colorMode: 'dark' },
88+
...Playground,
89+
args: {
90+
...Playground.args,
91+
position: 'bottom',
92+
},
93+
};
94+
95+
export const HighContrastMode: Story = {
96+
tags: ['vrt-only'],
97+
globals: { highContrastMode: true, colorMode: 'dark' },
98+
...Playground,
99+
args: {
100+
...Playground.args,
101+
position: 'left',
102+
},
74103
};

0 commit comments

Comments
 (0)