Skip to content

Commit 102c8a5

Browse files
Bump jest-environment-jsdom from 29.7.0 to 30.0.0 (#14195)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Pascal Birchler <pascalb@google.com>
1 parent 1e61c8e commit 102c8a5

File tree

10 files changed

+931
-817
lines changed

10 files changed

+931
-817
lines changed

package-lock.json

Lines changed: 869 additions & 738 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@
136136
"jest": "^29.7.0",
137137
"jest-axe": "^9.0.0",
138138
"jest-canvas-mock": "^2.5.2",
139-
"jest-environment-jsdom": "^29.6.1",
139+
"jest-environment-jsdom": "^30.0.0",
140140
"jest-extended": "^4.0.0",
141141
"jest-fetch-mock": "^3.0.3",
142142
"jest-matcher-deep-close-to": "^3.0.2",

packages/activation-notice/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,6 @@
3838
},
3939
"devDependencies": {
4040
"@storybook/addon-essentials": "^8.6.12",
41-
"@testing-library/react": "^14.0.0"
41+
"@testing-library/react": "^16.3.0"
4242
}
4343
}

packages/stories-block/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,6 @@
5252
"prop-types": "^15.8.1"
5353
},
5454
"devDependencies": {
55-
"@testing-library/react": "^14.0.0"
55+
"@testing-library/react": "^16.3.0"
5656
}
5757
}

packages/stories-block/src/block/components/autocomplete.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ const Autocomplete = ({
4545
label={label}
4646
placeholder={placeholder}
4747
__nextHasNoMarginBottom
48+
__next40pxDefaultSize
4849
/>
4950
</div>
5051
)

packages/story-editor/src/components/canvas/test/__snapshots__/mediaDisplay.js.snap

Lines changed: 2 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/story-editor/src/components/checklist/checks/test/storyAmpValidationErrors.js

Lines changed: 49 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,20 @@ import { getStoryAmpValidationErrors } from '../storyAmpValidationErrors';
2121

2222
describe('getStoryAmpValidationErrors', () => {
2323
const fetchSpy = jest.spyOn(window, 'fetch');
24-
const windowSpy = jest.spyOn(window, 'window', 'get');
2524

2625
beforeAll(() => {
2726
fetchSpy.mockResolvedValue({
2827
text: () => ({
2928
status: 200,
3029
}),
3130
});
31+
32+
delete window.amp;
3233
});
3334

3435
afterAll(() => {
3536
fetchSpy.mockClear();
36-
windowSpy.mockRestore();
37+
delete window.amp;
3738
});
3839

3940
it('should return false if no link', async () => {
@@ -43,16 +44,14 @@ describe('getStoryAmpValidationErrors', () => {
4344
});
4445

4546
it('should return false if there are no violations', async () => {
46-
windowSpy.mockImplementation(() => ({
47-
amp: {
48-
validator: {
49-
validateString: () => ({
50-
status: 'PASS',
51-
errors: [],
52-
}),
53-
},
47+
window.amp = {
48+
validator: {
49+
validateString: () => ({
50+
status: 'PASS',
51+
errors: [],
52+
}),
5453
},
55-
}));
54+
};
5655

5756
await expect(
5857
getStoryAmpValidationErrors({
@@ -63,25 +62,23 @@ describe('getStoryAmpValidationErrors', () => {
6362
});
6463

6564
it('should return true if there are AMP violations', async () => {
66-
windowSpy.mockImplementation(() => ({
67-
amp: {
68-
validator: {
69-
init: () => {},
70-
validateString: () => ({
71-
status: 'FAIL',
72-
errors: [
73-
{ code: 'INVALID_URL_PROTOCOL', severity: 'ERROR' },
74-
{ code: 'TAG_REQUIRED_BY_MISSING', severity: 'ERROR' },
75-
{
76-
code: 'MISSING_URL',
77-
severity: 'ERROR',
78-
params: ['poster-portrait-src'],
79-
},
80-
],
81-
}),
82-
},
65+
window.amp = {
66+
validator: {
67+
init: () => {},
68+
validateString: () => ({
69+
status: 'FAIL',
70+
errors: [
71+
{ code: 'INVALID_URL_PROTOCOL', severity: 'ERROR' },
72+
{ code: 'TAG_REQUIRED_BY_MISSING', severity: 'ERROR' },
73+
{
74+
code: 'MISSING_URL',
75+
severity: 'ERROR',
76+
params: ['poster-portrait-src'],
77+
},
78+
],
79+
}),
8380
},
84-
}));
81+
};
8582

8683
await expect(
8784
getStoryAmpValidationErrors({
@@ -92,19 +89,17 @@ describe('getStoryAmpValidationErrors', () => {
9289
});
9390

9491
it('should return false if there are no ERROR severity errors', async () => {
95-
windowSpy.mockImplementation(() => ({
96-
amp: {
97-
validator: {
98-
validateString: () => ({
99-
status: 'FAIL',
100-
errors: [
101-
{ severity: 'WARNING' },
102-
{ code: 'LOREM IPSUM', severity: 'WARNING' },
103-
],
104-
}),
105-
},
92+
window.amp = {
93+
validator: {
94+
validateString: () => ({
95+
status: 'FAIL',
96+
errors: [
97+
{ severity: 'WARNING' },
98+
{ code: 'LOREM IPSUM', severity: 'WARNING' },
99+
],
100+
}),
106101
},
107-
}));
102+
};
108103

109104
await expect(
110105
getStoryAmpValidationErrors({
@@ -115,22 +110,20 @@ describe('getStoryAmpValidationErrors', () => {
115110
});
116111

117112
it('should return false if MISSING URL is the only AMP Violation', async () => {
118-
windowSpy.mockImplementation(() => ({
119-
amp: {
120-
validator: {
121-
validateString: () => ({
122-
status: 'FAIL',
123-
errors: [
124-
{
125-
code: 'MISSING_URL',
126-
severity: 'ERROR',
127-
params: ['poster-portrait-src'],
128-
},
129-
],
130-
}),
131-
},
113+
window.amp = {
114+
validator: {
115+
validateString: () => ({
116+
status: 'FAIL',
117+
errors: [
118+
{
119+
code: 'MISSING_URL',
120+
severity: 'ERROR',
121+
params: ['poster-portrait-src'],
122+
},
123+
],
124+
}),
132125
},
133-
}));
126+
};
134127

135128
await expect(
136129
getStoryAmpValidationErrors({

packages/story-editor/src/components/library/test/mediaElement.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ describe('MediaElement', () => {
126126
});
127127
const { container } = renderMediaElement(IMAGE_RESOURCE, 'local');
128128

129-
const results = await axe(container);
129+
const results = await axe(container, { preload: false });
130130
expect(results).toHaveNoViolations();
131131
}, 30000);
132132

@@ -137,7 +137,7 @@ describe('MediaElement', () => {
137137
});
138138
const { container } = renderMediaElement(GIF_RESOURCE, 'local');
139139

140-
const results = await axe(container);
140+
const results = await axe(container, { preload: false });
141141
expect(results).toHaveNoViolations();
142142
}, 30000);
143143

@@ -148,7 +148,7 @@ describe('MediaElement', () => {
148148
});
149149
const { container } = renderMediaElement(VIDEO_RESOURCE, 'local');
150150

151-
const results = await axe(container);
151+
const results = await axe(container, { preload: false });
152152
expect(results).toHaveNoViolations();
153153
}, 30000);
154154

packages/tinymce-button/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@
3434
"prop-types": "^15.8.1"
3535
},
3636
"devDependencies": {
37-
"@testing-library/react": "^14.0.0"
37+
"@testing-library/react": "^16.3.0"
3838
}
3939
}

tests/js/jest.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,9 @@ export default {
136136
'<rootDir>/packages/stories-block/node_modules/react/index.js',
137137
'^react-dom(/.*)$':
138138
'<rootDir>/packages/stories-block/node_modules/react-dom/$1',
139+
// Ditto for React Testing Library.
140+
'^@testing-library/react$':
141+
'<rootDir>/packages/stories-block/node_modules/@testing-library/react/dist/index.js',
139142
},
140143
testMatch: [
141144
'<rootDir>/packages/activation-notice/**/test/**/*.{js,jsx,ts,tsx}',

0 commit comments

Comments
 (0)