-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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: legend size, use offset height and width #4307
Conversation
test/component/Legend.spec.tsx
Outdated
@@ -771,13 +790,13 @@ describe('<Legend />', () => { | |||
animationDuration: 1500, | |||
animationEasing: 'ease', | |||
animationId: 0, | |||
bottom: 5, | |||
bottom: 65, |
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.
unsure why all of these changed to be honest...
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.
Is it because the cleanup function from mockHTMLElementProperty
is never called? Best to do that in afterEach
. Check out the restoreGetBoundingClientRect
and how it's used.
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.
fixed, oops.
So in an afterEach
doesn't work well unless we want to make the mock specific for offsetHeight and offsetWidth. I tried restoring the entire HTMLElement.prototype
but that didn't seem to work.
I'm sure there's a better way but not enough time to get there at least atm :P
@zhonglin94 fyi |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## 3.x #4307 +/- ##
==========================================
+ Coverage 94.68% 94.73% +0.04%
==========================================
Files 92 92
Lines 20114 20116 +2
Branches 2810 2809 -1
==========================================
+ Hits 19045 19056 +11
+ Misses 1063 1054 -9
Partials 6 6 ☔ View full report in Codecov by Sentry. |
test/component/Legend.spec.tsx
Outdated
@@ -771,13 +790,13 @@ describe('<Legend />', () => { | |||
animationDuration: 1500, | |||
animationEasing: 'ease', | |||
animationId: 0, | |||
bottom: 5, | |||
bottom: 65, |
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.
Is it because the cleanup function from mockHTMLElementProperty
is never called? Best to do that in afterEach
. Check out the restoreGetBoundingClientRect
and how it's used.
c4bcafa
to
a75a81b
Compare
Description
Same PR as
#4272
but for 3.x
Related Issue
#4246
Motivation and Context
#4246
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: