Skip to content

Commit a622dad

Browse files
committed
Revert "Upgrade to jest 25 (facebook#17896)"
This reverts commit cf00812. The changes to the test code relate to changes in JSDOM that come with Jest 25: * Several JSDOM workarounds are no longer needed. * Several tests made assertions to match incorrect JSDOM behavior (e.g. setAttribute calls) that JSDOM has now patched to match browsers. * https://codesandbox.io/s/resets-value-of-datetime-input-to-fix-bugs-in-ios-safari-1ppwh * JSDOM no longer triggers default actions when dispatching click events. * https://codesandbox.io/s/beautiful-cdn-ugn8f * JSDOM fixed (jsdom/jsdom#2700) a bug so that calling focus() on an already focused element does not dispatch a FocusEvent. * JSDOM now supports passive events. * JSDOM has improved support for custom CSS properties. * But requires jsdom/cssstyle#112 to land to support webkit prefixed properties.
1 parent dbd85a0 commit a622dad

17 files changed

+990
-1128
lines changed

fixtures/dom/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"classnames": "^2.2.5",
1212
"codemirror": "^5.40.0",
1313
"core-js": "^2.4.1",
14-
"jest-diff": "^25.1.0",
14+
"jest-diff": "^24.8.0",
1515
"prop-types": "^15.6.0",
1616
"query-string": "^4.2.3",
1717
"react": "^15.4.1",

fixtures/dom/yarn.lock

+62-87
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,14 @@
66
version "7.0.0"
77
resolved "https://registry.yarnpkg.com/@babel/standalone/-/standalone-7.0.0.tgz#856446641620c1c5f0ca775621d478324ebd1f52"
88

9-
"@jest/types@^25.1.0":
10-
version "25.1.0"
11-
resolved "https://registry.yarnpkg.com/@jest/types/-/types-25.1.0.tgz#b26831916f0d7c381e11dbb5e103a72aed1b4395"
12-
integrity sha512-VpOtt7tCrgvamWZh1reVsGADujKigBUFTi19mlRjqEGsE8qH4r3s+skY33dNdXOwyZIvuftZ5tqdF1IgsMejMA==
9+
"@jest/types@^24.8.0":
10+
version "24.8.0"
11+
resolved "https://registry.yarnpkg.com/@jest/types/-/types-24.8.0.tgz#f31e25948c58f0abd8c845ae26fcea1491dea7ad"
12+
integrity sha512-g17UxVr2YfBtaMUxn9u/4+siG1ptg9IGYAYwvpwn61nBg779RXnjE/m7CxYcIzEt0AbHZZAHSEZNhkE2WxURVg==
1313
dependencies:
1414
"@types/istanbul-lib-coverage" "^2.0.0"
1515
"@types/istanbul-reports" "^1.1.1"
16-
"@types/yargs" "^15.0.0"
17-
chalk "^3.0.0"
18-
19-
"@types/color-name@^1.1.1":
20-
version "1.1.1"
21-
resolved "https://registry.yarnpkg.com/@types/color-name/-/color-name-1.1.1.tgz#1c1261bbeaa10a8055bbc5d8ab84b7b2afc846a0"
22-
integrity sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==
16+
"@types/yargs" "^12.0.9"
2317

2418
"@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0":
2519
version "2.0.1"
@@ -41,17 +35,10 @@
4135
"@types/istanbul-lib-coverage" "*"
4236
"@types/istanbul-lib-report" "*"
4337

44-
"@types/yargs-parser@*":
45-
version "15.0.0"
46-
resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-15.0.0.tgz#cb3f9f741869e20cce330ffbeb9271590483882d"
47-
integrity sha512-FA/BWv8t8ZWJ+gEOnLLd8ygxH/2UFbAvgEonyfN6yWGLKc7zVjbpl2Y4CTjid9h2RfgPP6SEt6uHwEOply00yw==
48-
49-
"@types/yargs@^15.0.0":
50-
version "15.0.1"
51-
resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-15.0.1.tgz#9266a9d7be68cfcc982568211085a49a277f7c96"
52-
integrity sha512-sYlwNU7zYi6eZbMzFvG6eHD7VsEvFdoDtlD7eI1JTg7YNnuguzmiGsc6MPSq5l8n+h21AsNof0je+9sgOe4+dg==
53-
dependencies:
54-
"@types/yargs-parser" "*"
38+
"@types/yargs@^12.0.9":
39+
version "12.0.12"
40+
resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-12.0.12.tgz#45dd1d0638e8c8f153e87d296907659296873916"
41+
integrity sha512-SOhuU4wNBxhhTHxYaiG5NY4HBhDIDnJF60GU+2LqHAdKKer86//e4yg69aENCtQ04n0ovz+tq2YPME5t5yp4pw==
5542

5643
abab@^1.0.3:
5744
version "1.0.3"
@@ -187,10 +174,10 @@ ansi-regex@^3.0.0:
187174
version "3.0.0"
188175
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998"
189176

190-
ansi-regex@^5.0.0:
191-
version "5.0.0"
192-
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.0.tgz#388539f55179bf39339c81af30a654d69f87cb75"
193-
integrity sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==
177+
ansi-regex@^4.0.0:
178+
version "4.1.0"
179+
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997"
180+
integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==
194181

195182
ansi-styles@^2.2.1:
196183
version "2.2.1"
@@ -202,13 +189,12 @@ ansi-styles@^3.0.0, ansi-styles@^3.1.0:
202189
dependencies:
203190
color-convert "^1.9.0"
204191

205-
ansi-styles@^4.0.0, ansi-styles@^4.1.0:
206-
version "4.2.1"
207-
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.2.1.tgz#90ae75c424d008d2624c5bf29ead3177ebfcf359"
208-
integrity sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==
192+
ansi-styles@^3.2.0, ansi-styles@^3.2.1:
193+
version "3.2.1"
194+
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d"
195+
integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==
209196
dependencies:
210-
"@types/color-name" "^1.1.1"
211-
color-convert "^2.0.1"
197+
color-convert "^1.9.0"
212198

213199
anymatch@^1.3.0:
214200
version "1.3.0"
@@ -1521,13 +1507,14 @@ chalk@^2.0.0, chalk@^2.1.0:
15211507
escape-string-regexp "^1.0.5"
15221508
supports-color "^4.0.0"
15231509

1524-
chalk@^3.0.0:
1525-
version "3.0.0"
1526-
resolved "https://registry.yarnpkg.com/chalk/-/chalk-3.0.0.tgz#3f73c2bf526591f574cc492c51e2456349f844e4"
1527-
integrity sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==
1510+
chalk@^2.0.1:
1511+
version "2.4.2"
1512+
resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424"
1513+
integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==
15281514
dependencies:
1529-
ansi-styles "^4.1.0"
1530-
supports-color "^7.1.0"
1515+
ansi-styles "^3.2.1"
1516+
escape-string-regexp "^1.0.5"
1517+
supports-color "^5.3.0"
15311518

15321519
chokidar@^1.6.0, chokidar@^1.7.0:
15331520
version "1.7.0"
@@ -1639,22 +1626,10 @@ color-convert@^1.9.0:
16391626
dependencies:
16401627
color-name "^1.1.1"
16411628

1642-
color-convert@^2.0.1:
1643-
version "2.0.1"
1644-
resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3"
1645-
integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==
1646-
dependencies:
1647-
color-name "~1.1.4"
1648-
16491629
color-name@^1.0.0, color-name@^1.1.1:
16501630
version "1.1.1"
16511631
resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.1.tgz#4b1415304cf50028ea81643643bd82ea05803689"
16521632

1653-
color-name@~1.1.4:
1654-
version "1.1.4"
1655-
resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2"
1656-
integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==
1657-
16581633
color-string@^0.3.0:
16591634
version "0.3.0"
16601635
resolved "https://registry.yarnpkg.com/color-string/-/color-string-0.3.0.tgz#27d46fb67025c5c2fa25993bfbf579e47841b991"
@@ -2138,10 +2113,10 @@ detect-port-alt@1.1.3:
21382113
address "^1.0.1"
21392114
debug "^2.6.0"
21402115

2141-
diff-sequences@^25.1.0:
2142-
version "25.1.0"
2143-
resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-25.1.0.tgz#fd29a46f1c913fd66c22645dc75bffbe43051f32"
2144-
integrity sha512-nFIfVk5B/NStCsJ+zaPO4vYuLjlzQ6uFvPxzYyHlejNZ/UGa7G/n7peOXVrVNvRuyfstt+mZQYGpjxg9Z6N8Kw==
2116+
diff-sequences@^24.3.0:
2117+
version "24.3.0"
2118+
resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-24.3.0.tgz#0f20e8a1df1abddaf4d9c226680952e64118b975"
2119+
integrity sha512-xLqpez+Zj9GKSnPWS0WZw1igGocZ+uua8+y+5dDNTT934N3QuY1sp2LkHzwiaYQGz60hMq0pjAshdeXm5VUOEw==
21452120

21462121
diff@^3.2.0:
21472122
version "3.3.0"
@@ -3205,10 +3180,10 @@ has-flag@^2.0.0:
32053180
version "2.0.0"
32063181
resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-2.0.0.tgz#e8207af1cc7b30d446cc70b734b5e8be18f88d51"
32073182

3208-
has-flag@^4.0.0:
3209-
version "4.0.0"
3210-
resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b"
3211-
integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==
3183+
has-flag@^3.0.0:
3184+
version "3.0.0"
3185+
resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd"
3186+
integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0=
32123187

32133188
has-unicode@^2.0.0:
32143189
version "2.0.1"
@@ -3861,15 +3836,15 @@ jest-diff@^20.0.3:
38613836
jest-matcher-utils "^20.0.3"
38623837
pretty-format "^20.0.3"
38633838

3864-
jest-diff@^25.1.0:
3865-
version "25.1.0"
3866-
resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-25.1.0.tgz#58b827e63edea1bc80c1de952b80cec9ac50e1ad"
3867-
integrity sha512-nepXgajT+h017APJTreSieh4zCqnSHEJ1iT8HDlewu630lSJ4Kjjr9KNzm+kzGwwcpsDE6Snx1GJGzzsefaEHw==
3839+
jest-diff@^24.8.0:
3840+
version "24.8.0"
3841+
resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-24.8.0.tgz#146435e7d1e3ffdf293d53ff97e193f1d1546172"
3842+
integrity sha512-wxetCEl49zUpJ/bvUmIFjd/o52J+yWcoc5ZyPq4/W1LUKGEhRYDIbP1KcF6t+PvqNrGAFk4/JhtxDq/Nnzs66g==
38683843
dependencies:
3869-
chalk "^3.0.0"
3870-
diff-sequences "^25.1.0"
3871-
jest-get-type "^25.1.0"
3872-
pretty-format "^25.1.0"
3844+
chalk "^2.0.1"
3845+
diff-sequences "^24.3.0"
3846+
jest-get-type "^24.8.0"
3847+
pretty-format "^24.8.0"
38733848

38743849
jest-docblock@^20.0.3:
38753850
version "20.0.3"
@@ -3890,10 +3865,10 @@ jest-environment-node@^20.0.3:
38903865
jest-mock "^20.0.3"
38913866
jest-util "^20.0.3"
38923867

3893-
jest-get-type@^25.1.0:
3894-
version "25.1.0"
3895-
resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-25.1.0.tgz#1cfe5fc34f148dc3a8a3b7275f6b9ce9e2e8a876"
3896-
integrity sha512-yWkBnT+5tMr8ANB6V+OjmrIJufHtCAqI5ic2H40v+tRqxDmE0PGnIiTyvRWFOMtmVHYpwRqyazDbTnhpjsGvLw==
3868+
jest-get-type@^24.8.0:
3869+
version "24.8.0"
3870+
resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-24.8.0.tgz#a7440de30b651f5a70ea3ed7ff073a32dfe646fc"
3871+
integrity sha512-RR4fo8jEmMD9zSz2nLbs2j0zvPpk/KCEz3a62jJWbd2ayNo0cb+KFRxPHVhE4ZmgGJEQp0fosmNz84IfqM8cMQ==
38973872

38983873
jest-haste-map@^20.0.4:
38993874
version "20.0.5"
@@ -5360,15 +5335,15 @@ pretty-format@^20.0.3:
53605335
ansi-regex "^2.1.1"
53615336
ansi-styles "^3.0.0"
53625337

5363-
pretty-format@^25.1.0:
5364-
version "25.1.0"
5365-
resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-25.1.0.tgz#ed869bdaec1356fc5ae45de045e2c8ec7b07b0c8"
5366-
integrity sha512-46zLRSGLd02Rp+Lhad9zzuNZ+swunitn8zIpfD2B4OPCRLXbM87RJT2aBLBWYOznNUML/2l/ReMyWNC80PJBUQ==
5338+
pretty-format@^24.8.0:
5339+
version "24.8.0"
5340+
resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-24.8.0.tgz#8dae7044f58db7cb8be245383b565a963e3c27f2"
5341+
integrity sha512-P952T7dkrDEplsR+TuY7q3VXDae5Sr7zmQb12JU/NDQa/3CH7/QW0yvqLcGN6jL+zQFKaoJcPc+yJxMTGmosqw==
53675342
dependencies:
5368-
"@jest/types" "^25.1.0"
5369-
ansi-regex "^5.0.0"
5370-
ansi-styles "^4.0.0"
5371-
react-is "^16.12.0"
5343+
"@jest/types" "^24.8.0"
5344+
ansi-regex "^4.0.0"
5345+
ansi-styles "^3.2.0"
5346+
react-is "^16.8.4"
53725347

53735348
private@^0.1.6:
53745349
version "0.1.6"
@@ -5556,10 +5531,10 @@ react-error-overlay@^1.0.10:
55565531
settle-promise "1.0.0"
55575532
source-map "0.5.6"
55585533

5559-
react-is@^16.12.0:
5560-
version "16.12.0"
5561-
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.12.0.tgz#2cc0fe0fba742d97fd527c42a13bec4eeb06241c"
5562-
integrity sha512-rPCkf/mWBtKc97aLL9/txD8DZdemK0vkA3JMLShjlJB3Pj3s+lpf1KaBzMfQrAmhMQB0n1cU/SUGgKKBCe837Q==
5534+
react-is@^16.8.4:
5535+
version "16.8.6"
5536+
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.8.6.tgz#5bbc1e2d29141c9fbdfed456343fe2bc430a6a16"
5537+
integrity sha512-aUk3bHfZ2bRSVFFbbeVS4i+lNPZr3/WM5jT2J5omUVV1zzcs1nAaf3l51ctA5FFvCRbhrH0bdAsRRQddFJZPtA==
55635538

55645539
react-scripts@^1.0.11:
55655540
version "1.0.11"
@@ -6379,12 +6354,12 @@ supports-color@^4.0.0, supports-color@^4.2.1:
63796354
dependencies:
63806355
has-flag "^2.0.0"
63816356

6382-
supports-color@^7.1.0:
6383-
version "7.1.0"
6384-
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.1.0.tgz#68e32591df73e25ad1c4b49108a2ec507962bfd1"
6385-
integrity sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==
6357+
supports-color@^5.3.0:
6358+
version "5.5.0"
6359+
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f"
6360+
integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==
63866361
dependencies:
6387-
has-flag "^4.0.0"
6362+
has-flag "^3.0.0"
63886363

63896364
svgo@^0.7.0:
63906365
version "0.7.1"

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@
6464
"google-closure-compiler": "^20200112.0.0",
6565
"gzip-size": "^5.1.1",
6666
"jasmine-check": "^1.0.0-rc.0",
67-
"jest": "^25.1.0",
68-
"jest-diff": "^25.1.0",
67+
"jest": "^24.9.0",
68+
"jest-diff": "^24.9.0",
6969
"jest-snapshot-serializer-raw": "^1.1.0",
7070
"minimatch": "^3.0.4",
7171
"minimist": "^1.2.0",

packages/jest-mock-scheduler/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
},
2020
"homepage": "https://reactjs.org/",
2121
"peerDependencies": {
22-
"jest": "^23.0.1 || ^24.0.0 || ^25.1.0",
22+
"jest": "^23.0.1 || ^24.0.0",
2323
"scheduler": "^0.15.0"
2424
},
2525
"files": [

packages/jest-react/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
},
2020
"homepage": "https://reactjs.org/",
2121
"peerDependencies": {
22-
"jest": "^23.0.1 || ^24.0.0 || ^25.1.0",
22+
"jest": "^23.0.1 || ^24.0.0",
2323
"react": "^16.0.0",
2424
"react-test-renderer": "^16.0.0"
2525
},

packages/react-dom/src/__tests__/CSSPropertyOperations-test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -245,13 +245,13 @@ describe('CSSPropertyOperations', () => {
245245
it('should not add units to CSS custom properties', () => {
246246
class Comp extends React.Component {
247247
render() {
248-
return <div style={{'--foo': '5'}} />;
248+
return <div style={{'--foo': 5}} />;
249249
}
250250
}
251251

252252
const root = document.createElement('div');
253253
ReactDOM.render(<Comp />, root);
254254

255-
expect(root.children[0].style.getPropertyValue('--foo')).toEqual('5');
255+
expect(root.children[0].style.Foo).toEqual('5');
256256
});
257257
});

packages/react-dom/src/__tests__/ReactDOMComponent-test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -2375,7 +2375,7 @@ describe('ReactDOMComponent', () => {
23752375
const container = document.createElement('div');
23762376

23772377
ReactDOM.render(<img src={obj} />, container);
2378-
expect(container.firstChild.src).toBe('http://localhost/hello');
2378+
expect(container.firstChild.src).toBe('hello');
23792379

23802380
ReactDOM.render(<svg arabicForm={obj} />, container);
23812381
expect(container.firstChild.getAttribute('arabic-form')).toBe('hello');
@@ -2409,7 +2409,7 @@ describe('ReactDOMComponent', () => {
24092409
const child = Object.create(parent);
24102410
const el = ReactTestUtils.renderIntoDocument(<img src={child} />);
24112411

2412-
expect(el.src).toBe('http://localhost/hello.jpg');
2412+
expect(el.src).toBe('hello.jpg');
24132413
});
24142414

24152415
it('assigns ajaxify (an important internal FB attribute)', function() {

packages/react-dom/src/__tests__/ReactDOMInput-test.js

+27-9
Original file line numberDiff line numberDiff line change
@@ -1543,7 +1543,8 @@ describe('ReactDOMInput', () => {
15431543
);
15441544
});
15451545

1546-
it('sets type, step, min, max before value always', () => {
1546+
// FIXME: Re-enable this test when upgrading to Jest 25
1547+
it.skip('sets type, step, min, max before value always', () => {
15471548
const log = [];
15481549
const originalCreateElement = document.createElement;
15491550
spyOnDevAndProd(document, 'createElement').and.callFake(function(type) {
@@ -1579,13 +1580,26 @@ describe('ReactDOMInput', () => {
15791580
container,
15801581
);
15811582

1582-
expect(log).toEqual([
1583-
'set attribute type',
1584-
'set attribute min',
1585-
'set attribute max',
1586-
'set attribute step',
1587-
'set property value',
1588-
]);
1583+
if (disableInputAttributeSyncing) {
1584+
expect(log).toEqual([
1585+
'set attribute type',
1586+
'set attribute min',
1587+
'set attribute max',
1588+
'set attribute step',
1589+
'set property value',
1590+
]);
1591+
} else {
1592+
expect(log).toEqual([
1593+
'set attribute type',
1594+
'set attribute min',
1595+
'set attribute max',
1596+
'set attribute step',
1597+
'set property value',
1598+
'set attribute value',
1599+
// FIXME: This doesn't get logged in prod build??
1600+
'set attribute checked',
1601+
]);
1602+
}
15891603
});
15901604

15911605
it('sets value properly with type coming later in props', () => {
@@ -1612,7 +1626,8 @@ describe('ReactDOMInput', () => {
16121626
expect(node.value).toEqual('Test');
16131627
});
16141628

1615-
it('resets value of date/time input to fix bugs in iOS Safari', () => {
1629+
// FIXME: Re-enable this test when upgrading to Jest 25
1630+
it.skip('resets value of date/time input to fix bugs in iOS Safari', () => {
16161631
function strify(x) {
16171632
return JSON.stringify(x, null, 2);
16181633
}
@@ -1650,6 +1665,9 @@ describe('ReactDOMInput', () => {
16501665
expect(log).toEqual([
16511666
'node.setAttribute("type", "date")',
16521667
'node.value = "1980-01-01"',
1668+
'node.setAttribute("value", "1980-01-01")',
1669+
// FIXME: This doesn't get logged in prod build??
1670+
'node.setAttribute("checked", "")',
16531671
]);
16541672
}
16551673
});

0 commit comments

Comments
 (0)