-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Add jsdom and tests for calculateDimension #1934
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
base: master
Are you sure you want to change the base?
Conversation
|
@ljharb let me know if the PR works for you |
|
Going to need some help with this one. I think I can get the suite in a place where the jsdom tests pass. The issue is (as evidenced by the failing builds) is that JSDOM is really not happy with running in a browser (which occurs when the karma tests are run). To that end, I'm after a good strategy to seperate the jsdom tests so that they run exclusively during normal mocha run. I feel like the easiest way is to have a |
| parseFloat(style[`padding${axisStart}`]) | ||
| + parseFloat(style[`padding${axisEnd}`]) | ||
| + parseFloat(style[`border${axisStart}Width`]) | ||
| + parseFloat(style[`border${axisEnd}Width`]) | ||
| getStyleOrDefault(style, `padding${axisStart}`) | ||
| + getStyleOrDefault(style, `padding${axisEnd}`) | ||
| + getStyleOrDefault(style, `border${axisStart}Width`) | ||
| + getStyleOrDefault(style, `border${axisEnd}Width`) |
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.
i think inline || 0's here would be clearer
| describe('withMargin false and borderBox true when style properties are absent', () => { | ||
| let testElement = null; | ||
|
|
||
| beforeEach(() => { | ||
| const { window } = new JSDOM('<div />'); |
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.
i think maybe it'd make more sense to do one mocha run without jsdom, and another with? then describeIfWindow would be used to skip the DOM tests for that run.
That would also mean the karma tests wouldn't run with jsdom, since it'd be an entirely different test run.
Resolves #1426