Skip to content

Commit a21fede

Browse files
Bump jsdom from 16.0.1 to 16.1.0 (#19533)
1 parent 3722589 commit a21fede

File tree

3 files changed

+49
-24
lines changed

3 files changed

+49
-24
lines changed

packages/material-ui/src/Tabs/Tabs.test.js

+26-5
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ const hasRightScrollButton = container => findScrollButton(container, 'right') !
2525

2626
describe('<Tabs />', () => {
2727
const isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
28+
// tests mocking getBoundingClientRect prevent mocha to exit
29+
const isJSDOM = navigator.userAgent === 'node.js';
2830

2931
// The test fails on Safari with just:
3032
//
@@ -173,7 +175,11 @@ describe('<Tabs />', () => {
173175
expect(container.querySelector(`.${classes.indicator}`)).to.be.ok;
174176
});
175177

176-
it('should update the indicator at each render', () => {
178+
it('should update the indicator at each render', function test() {
179+
if (isJSDOM) {
180+
this.skip();
181+
}
182+
177183
const { setProps, container, getByRole } = render(
178184
<Tabs value={1}>
179185
<Tab />
@@ -281,7 +287,10 @@ describe('<Tabs />', () => {
281287
expect(container.querySelectorAll(selector)).to.have.lengthOf(1);
282288
});
283289

284-
it('should response to scroll events', () => {
290+
it('should response to scroll events', function test() {
291+
if (isJSDOM) {
292+
this.skip();
293+
}
285294
const { container, setProps, getByRole } = render(tabs);
286295
const tablistContainer = getByRole('tablist').parentElement;
287296

@@ -358,7 +367,11 @@ describe('<Tabs />', () => {
358367
expect(container.querySelectorAll(`.${classes.scrollButtons}`)).to.have.lengthOf(2);
359368
});
360369

361-
it('should handle window resize event', () => {
370+
it('should handle window resize event', function test() {
371+
if (isJSDOM) {
372+
this.skip();
373+
}
374+
362375
const { container, setProps, getByRole } = render(
363376
<Tabs
364377
value={0}
@@ -555,7 +568,11 @@ describe('<Tabs />', () => {
555568
clock.restore();
556569
});
557570

558-
it('should scroll left tab into view', () => {
571+
it('should scroll left tab into view', function test() {
572+
if (isJSDOM) {
573+
this.skip();
574+
}
575+
559576
const { setProps, getByRole } = render(
560577
<Tabs value={0} variant="scrollable" style={{ width: 200 }}>
561578
<Tab />
@@ -598,7 +615,11 @@ describe('<Tabs />', () => {
598615
});
599616

600617
describe('prop: orientation', () => {
601-
it('should support orientation="vertical"', () => {
618+
it('should support orientation="vertical"', function test() {
619+
if (isJSDOM) {
620+
this.skip();
621+
}
622+
602623
const { setProps, container, getByRole } = render(
603624
<Tabs value={1} variant="scrollable" scrollButtons="on" orientation="vertical">
604625
<Tab />

packages/material-ui/src/internal/animate.test.js

+15-11
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,21 @@ import { assert } from 'chai';
22
import animate from './animate';
33

44
describe('animate', () => {
5-
const isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
5+
let container;
66

7-
// The test fails on Safari with just:
8-
//
9-
// container.scrollLeft = 200;
10-
// assert.strictEqual(container.scrollLeft, 200); 💥
11-
if (isSafari) {
12-
return;
13-
}
7+
before(function beforeHook() {
8+
const isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
9+
const isJSDOM = navigator.userAgent === 'node.js';
10+
if (isJSDOM || isSafari) {
11+
// The test fails on Safari with just:
12+
//
13+
// container.scrollLeft = 200;
14+
// assert.strictEqual(container.scrollLeft, 200); 💥
1415

15-
let container;
16+
// in JSDOM the test prevents mocha from exiting
17+
this.skip();
18+
}
1619

17-
before(() => {
1820
container = document.createElement('div');
1921
container.style.cssText = [
2022
'height: 100px',
@@ -29,7 +31,9 @@ describe('animate', () => {
2931
});
3032

3133
after(() => {
32-
document.body.removeChild(container);
34+
if (container !== undefined) {
35+
document.body.removeChild(container);
36+
}
3337
});
3438

3539
it('should work', done => {

yarn.lock

+8-8
Original file line numberDiff line numberDiff line change
@@ -5286,10 +5286,10 @@ cssom@~0.3.6:
52865286
resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.8.tgz#9f1276f5b2b463f2114d3f2c75250af8c1a36f4a"
52875287
integrity sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg==
52885288

5289-
cssstyle@^2.0.0:
5290-
version "2.0.0"
5291-
resolved "https://registry.yarnpkg.com/cssstyle/-/cssstyle-2.0.0.tgz#911f0fe25532db4f5d44afc83f89cc4b82c97fe3"
5292-
integrity sha512-QXSAu2WBsSRXCPjvI43Y40m6fMevvyRm8JVAuF9ksQz5jha4pWP1wpaK7Yu5oLFc6+XAY+hj8YhefyXcBB53gg==
5289+
cssstyle@^2.1.0:
5290+
version "2.2.0"
5291+
resolved "https://registry.yarnpkg.com/cssstyle/-/cssstyle-2.2.0.tgz#e4c44debccd6b7911ed617a4395e5754bba59992"
5292+
integrity sha512-sEb3XFPx3jNnCAMtqrXPDeSgQr+jojtCeNf8cvMNMh1cG970+lljssvQDzPq6lmmJu2Vhqood/gtEomBiHOGnA==
52935293
dependencies:
52945294
cssom "~0.3.6"
52955295

@@ -8807,15 +8807,15 @@ jscodeshift@^0.7.0:
88078807
write-file-atomic "^2.3.0"
88088808

88098809
jsdom@^16.0.0:
8810-
version "16.0.1"
8811-
resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-16.0.1.tgz#5a5214cf69609531bf6fa5b6322fdd90ceed5bf7"
8812-
integrity sha512-wKJe/APzq+ak9i+2ybWE20lDIhF9AkGKSZf8UsjPN39acatFB6oA7K397kQvHVikds0yQono2h6J7UjbPtPOWw==
8810+
version "16.1.0"
8811+
resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-16.1.0.tgz#7e245db708ee00302947be7beb88a2ffa587ad2b"
8812+
integrity sha512-kpIcNAuZYc/L17WADOOHslz/q5+3SipP/iRb3j6zd1zQ6pFJubLi/VCdD3NqBpj/IKKK4YXny1vv44rbEUSGFg==
88138813
dependencies:
88148814
abab "^2.0.3"
88158815
acorn "^7.1.0"
88168816
acorn-globals "^4.3.2"
88178817
cssom "^0.4.4"
8818-
cssstyle "^2.0.0"
8818+
cssstyle "^2.1.0"
88198819
data-urls "^2.0.0"
88208820
decimal.js "^10.2.0"
88218821
domexception "^2.0.1"

0 commit comments

Comments
 (0)