Skip to content
Snippets Groups Projects
Unverified Commit 6abe4bb8 authored by Uladzimir Havenchyk's avatar Uladzimir Havenchyk Committed by GitHub
Browse files

test: do not allow cypress to raise an error on timeline hover (#46230)

* do not update size if width or height is 0

* add a comment
parent 2512d29a
Branches
Tags
No related merge requests found
......@@ -197,6 +197,13 @@ function ExplicitSize<T extends BaseInnerProps>({
const element = this._getElement();
if (element) {
const { width, height } = element.getBoundingClientRect();
if (!width && !height) {
// cypress raises lots of errors in timeline trying to call setState
// on the unmounted element, so we're just ignoring
return;
}
if (this.state.width !== width || this.state.height !== height) {
this.setState({ width, height }, () =>
this.props?.onUpdateSize?.(),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment