Skip to content

Commit c498a5a

Browse files
authored
chore: update emotion to v11 (#6940)
1 parent 885131f commit c498a5a

File tree

67 files changed

+3131
-3066
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+3131
-3066
lines changed

babel.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ function presets() {
4646
[
4747
'@emotion/babel-preset-css-prop',
4848
{
49-
autoLabel: true,
49+
autoLabel: 'always',
5050
},
5151
],
5252
'@babel/typescript',

jest.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ module.exports = {
1010
'\\.(css|less)$': '<rootDir>/__mocks__/styleMock.js',
1111
},
1212
testURL: 'http://localhost:8080',
13-
snapshotSerializers: ['jest-emotion'],
13+
snapshotSerializers: ['@emotion/jest/serializer'],
1414
transformIgnorePatterns: [
1515
'node_modules/(?!copy-text-to-clipboard|clean-stack|escape-string-regexp)',
1616
],

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@
8888
"@commitlint/cli": "^16.0.0",
8989
"@commitlint/config-conventional": "^16.0.0",
9090
"@emotion/eslint-plugin": "^11.0.0",
91+
"@emotion/jest": "^11.11.0",
9192
"@octokit/rest": "^16.28.7",
9293
"@soda/friendly-errors-webpack-plugin": "^1.8.1",
9394
"@storybook/addon-actions": "^5.3.6",
@@ -141,7 +142,6 @@
141142
"husky": "^7.0.0",
142143
"jest": "^27.0.0",
143144
"jest-cli": "^27.0.0",
144-
"jest-emotion": "^10.0.32",
145145
"js-yaml": "^4.0.0",
146146
"mockserver-client": "^5.8.0",
147147
"mockserver-node": "^5.8.0",
@@ -184,10 +184,10 @@
184184
},
185185
"private": true,
186186
"dependencies": {
187-
"@emotion/babel-preset-css-prop": "^10.0.27",
187+
"@emotion/babel-preset-css-prop": "^11.11.0",
188188
"browserify": "^17.0.0",
189189
"buffer": "^6.0.3",
190-
"emotion": "^10.0.9",
190+
"emotion": "^11.0.0",
191191
"eslint-config-prettier": "^8.0.0",
192192
"eslint-plugin-babel": "^5.3.0",
193193
"globby": "^12.0.0",

packages/decap-cms-app/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
],
2727
"license": "MIT",
2828
"dependencies": {
29-
"@emotion/core": "^10.0.35",
30-
"@emotion/styled": "^10.0.27",
29+
"@emotion/react": "^11.11.1",
30+
"@emotion/styled": "^11.11.0",
3131
"codemirror": "^5.46.0",
3232
"decap-cms-backend-azure": "^3.0.1",
3333
"decap-cms-backend-bitbucket": "^3.0.1",

packages/decap-cms-backend-azure/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
"semaphore": "^1.1.0"
2525
},
2626
"peerDependencies": {
27-
"@emotion/core": "^10.0.9",
28-
"@emotion/styled": "^10.0.9",
27+
"@emotion/react": "^11.11.1",
28+
"@emotion/styled": "^11.11.0",
2929
"decap-cms-lib-auth": "^3.0.0",
3030
"decap-cms-lib-util": "^3.0.0",
3131
"decap-cms-ui-default": "^3.0.0",

packages/decap-cms-backend-bitbucket/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
"what-the-diff": "^0.6.0"
2626
},
2727
"peerDependencies": {
28-
"@emotion/core": "^10.0.35",
29-
"@emotion/styled": "^10.0.27",
28+
"@emotion/react": "^11.11.1",
29+
"@emotion/styled": "^11.11.0",
3030
"decap-cms-lib-auth": "^3.0.0",
3131
"decap-cms-lib-util": "^3.0.0",
3232
"decap-cms-ui-default": "^3.0.0",

packages/decap-cms-backend-git-gateway/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
"minimatch": "^3.0.4"
2727
},
2828
"peerDependencies": {
29-
"@emotion/core": "^10.0.35",
30-
"@emotion/styled": "^10.0.27",
29+
"@emotion/react": "^11.11.1",
30+
"@emotion/styled": "^11.11.0",
3131
"decap-cms-backend-bitbucket": "^3.0.0",
3232
"decap-cms-backend-github": "^3.0.0",
3333
"decap-cms-backend-gitlab": "^3.0.0",

packages/decap-cms-backend-git-gateway/src/__tests__/AuthenticationPage.spec.js

+24-11
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import React from 'react';
22
import { render } from '@testing-library/react';
33

4+
import GitGatewayAuthenticationPage from '../AuthenticationPage';
5+
46
window.netlifyIdentity = {
57
currentUser: jest.fn(),
68
on: jest.fn(),
@@ -21,21 +23,32 @@ describe('GitGatewayAuthenticationPage', () => {
2123
});
2224

2325
it('should render with identity error', () => {
24-
const { default: GitGatewayAuthenticationPage } = require('../AuthenticationPage');
25-
const { asFragment } = render(<GitGatewayAuthenticationPage {...props} />);
26+
// obtain mock calls
27+
require('../AuthenticationPage');
28+
29+
function TestComponent() {
30+
const { asFragment } = render(<GitGatewayAuthenticationPage {...props} />);
2631

27-
const errorCallback = window.netlifyIdentity.on.mock.calls.find(call => call[0] === 'error')[1];
32+
const errorCallback = window.netlifyIdentity.on.mock.calls.find(
33+
call => call[0] === 'error',
34+
)[1];
2835

29-
errorCallback(
30-
new Error('Failed to load settings from https://site.netlify.com/.netlify/identity'),
31-
);
36+
errorCallback(
37+
new Error('Failed to load settings from https://site.netlify.com/.netlify/identity'),
38+
);
3239

33-
expect(asFragment()).toMatchSnapshot();
40+
expect(asFragment()).toMatchSnapshot();
41+
}
42+
43+
TestComponent();
3444
});
3545

36-
it('should render with no identity error', () => {
37-
const { default: GitGatewayAuthenticationPage } = require('../AuthenticationPage');
38-
const { asFragment } = render(<GitGatewayAuthenticationPage {...props} />);
39-
expect(asFragment()).toMatchSnapshot();
46+
test('should render with no identity error', () => {
47+
function TestComponent() {
48+
const { asFragment } = render(<GitGatewayAuthenticationPage {...props} />);
49+
expect(asFragment()).toMatchSnapshot();
50+
}
51+
52+
TestComponent();
4053
});
4154
});

0 commit comments

Comments
 (0)