-
-
Notifications
You must be signed in to change notification settings - Fork 529
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
Fix testing and minor refactorings #1171
Conversation
src/utils/index.ts
Outdated
import type { IComputePositions } from './compute-tooltip-position-types' | ||
import computeTooltipPosition from './compute-tooltip-position' | ||
import cssSupports from './css-supports' | ||
import cssTimeToMs from './css-time-to-ms' | ||
import debounce from './debounce' | ||
import getScrollParent from './get-scroll-parent' | ||
import useIsomorphicLayoutEffect from './use-isomorphic-layout-effect' | ||
|
||
export type { IComputePositions } | ||
export { | ||
computeTooltipPosition, | ||
cssSupports, | ||
cssTimeToMs, | ||
debounce, | ||
getScrollParent, | ||
useIsomorphicLayoutEffect, | ||
} |
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 some inconsistent exports here. All util functions are now default exported, and available with named export from utils/index.ts
.
For future reference, when testing the tooltip NOT to be on screen, we recommend the following (using await waitFor(() => {
expect(screen.queryByRole('tooltip')).not.toBeInTheDocument()
}) When getting a reference to the tooltip, we recommend this: const tooltip = await screen.findByRole('tooltip')
expect(tooltip).toHaveAttribute('style') Waiting for the tooltip to have the await waitFor(() => {
// also useful with `react-tooltip__closing`
expect(screen.queryByRole('tooltip')).toHaveClass('react-tooltip__show')
}) |
9be7a1d
to
cf29fc9
Compare
## [0.6.5](https://github.com/equinor/webviz-subsurface-components/compare/wsc-common@0.6.4...wsc-common@0.6.5) (2024-06-24) ### Bug Fixes * bump react-tooltip from 4.5.1 to 5.27.0 in /typescript ([#2104](#2104)) ([28bd015](28bd015)), closes [ReactTooltip/react-tooltip#1148](ReactTooltip/react-tooltip#1148) [ReactTooltip/react-tooltip#1196](ReactTooltip/react-tooltip#1196) [ReactTooltip/react-tooltip#1194](ReactTooltip/react-tooltip#1194) [ReactTooltip/react-tooltip#1187](ReactTooltip/react-tooltip#1187) [ReactTooltip/react-tooltip#1171](ReactTooltip/react-tooltip#1171) [ReactTooltip/react-tooltip#1169](ReactTooltip/react-tooltip#1169) [ReactTooltip/react-tooltip#1168](ReactTooltip/react-tooltip#1168) [ReactTooltip/react-tooltip#1170](ReactTooltip/react-tooltip#1170) [ReactTooltip/react-tooltip#1172](ReactTooltip/react-tooltip#1172) [#1196](#1196) [#1148](#1148)
## [1.2.17](https://github.com/equinor/webviz-subsurface-components/compare/well-completions-plot@1.2.16...well-completions-plot@1.2.17) (2024-06-24) ### Bug Fixes * bump react-tooltip from 4.5.1 to 5.27.0 in /typescript ([#2104](#2104)) ([28bd015](28bd015)), closes [ReactTooltip/react-tooltip#1148](ReactTooltip/react-tooltip#1148) [ReactTooltip/react-tooltip#1196](ReactTooltip/react-tooltip#1196) [ReactTooltip/react-tooltip#1194](ReactTooltip/react-tooltip#1194) [ReactTooltip/react-tooltip#1187](ReactTooltip/react-tooltip#1187) [ReactTooltip/react-tooltip#1171](ReactTooltip/react-tooltip#1171) [ReactTooltip/react-tooltip#1169](ReactTooltip/react-tooltip#1169) [ReactTooltip/react-tooltip#1168](ReactTooltip/react-tooltip#1168) [ReactTooltip/react-tooltip#1170](ReactTooltip/react-tooltip#1170) [ReactTooltip/react-tooltip#1172](ReactTooltip/react-tooltip#1172) [#1196](#1196) [#1148](#1148)
## [0.27.9](https://github.com/equinor/webviz-subsurface-components/compare/subsurface-viewer@0.27.8...subsurface-viewer@0.27.9) (2024-06-24) ### Bug Fixes * bump react-tooltip from 4.5.1 to 5.27.0 in /typescript ([#2104](#2104)) ([28bd015](28bd015)), closes [ReactTooltip/react-tooltip#1148](ReactTooltip/react-tooltip#1148) [ReactTooltip/react-tooltip#1196](ReactTooltip/react-tooltip#1196) [ReactTooltip/react-tooltip#1194](ReactTooltip/react-tooltip#1194) [ReactTooltip/react-tooltip#1187](ReactTooltip/react-tooltip#1187) [ReactTooltip/react-tooltip#1171](ReactTooltip/react-tooltip#1171) [ReactTooltip/react-tooltip#1169](ReactTooltip/react-tooltip#1169) [ReactTooltip/react-tooltip#1168](ReactTooltip/react-tooltip#1168) [ReactTooltip/react-tooltip#1170](ReactTooltip/react-tooltip#1170) [ReactTooltip/react-tooltip#1172](ReactTooltip/react-tooltip#1172) [#1196](#1196) [#1148](#1148)
## [1.1.17](https://github.com/equinor/webviz-subsurface-components/compare/group-tree-plot@1.1.16...group-tree-plot@1.1.17) (2024-06-24) ### Bug Fixes * bump react-tooltip from 4.5.1 to 5.27.0 in /typescript ([#2104](#2104)) ([28bd015](28bd015)), closes [ReactTooltip/react-tooltip#1148](ReactTooltip/react-tooltip#1148) [ReactTooltip/react-tooltip#1196](ReactTooltip/react-tooltip#1196) [ReactTooltip/react-tooltip#1194](ReactTooltip/react-tooltip#1194) [ReactTooltip/react-tooltip#1187](ReactTooltip/react-tooltip#1187) [ReactTooltip/react-tooltip#1171](ReactTooltip/react-tooltip#1171) [ReactTooltip/react-tooltip#1169](ReactTooltip/react-tooltip#1169) [ReactTooltip/react-tooltip#1168](ReactTooltip/react-tooltip#1168) [ReactTooltip/react-tooltip#1170](ReactTooltip/react-tooltip#1170) [ReactTooltip/react-tooltip#1172](ReactTooltip/react-tooltip#1172) [#1196](#1196) [#1148](#1148)
## [1.10.1](https://github.com/equinor/webviz-subsurface-components/compare/well-log-viewer@1.10.0...well-log-viewer@1.10.1) (2024-06-24) ### Bug Fixes * bump react-tooltip from 4.5.1 to 5.27.0 in /typescript ([#2104](#2104)) ([28bd015](28bd015)), closes [ReactTooltip/react-tooltip#1148](ReactTooltip/react-tooltip#1148) [ReactTooltip/react-tooltip#1196](ReactTooltip/react-tooltip#1196) [ReactTooltip/react-tooltip#1194](ReactTooltip/react-tooltip#1194) [ReactTooltip/react-tooltip#1187](ReactTooltip/react-tooltip#1187) [ReactTooltip/react-tooltip#1171](ReactTooltip/react-tooltip#1171) [ReactTooltip/react-tooltip#1169](ReactTooltip/react-tooltip#1169) [ReactTooltip/react-tooltip#1168](ReactTooltip/react-tooltip#1168) [ReactTooltip/react-tooltip#1170](ReactTooltip/react-tooltip#1170) [ReactTooltip/react-tooltip#1172](ReactTooltip/react-tooltip#1172) [#1196](#1196) [#1148](#1148)
Closes #1080.
Might close other test related issues. Will have to check.