Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(react-intl): support react 17 (#2301)
fix #2298
- Loading branch information
Showing
23 changed files
with
1,073 additions
and
1,311 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 12 additions & 11 deletions
23
packages/react-intl/tests/unit/components/__snapshots__/displayName.tsx.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,19 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`<FormattedDisplayName /> accepts Intl.DisplayNames options 1`] = ` | ||
<FormattedDisplayName | ||
type="currency" | ||
value="CNY" | ||
> | ||
Chinese Yuan | ||
</FormattedDisplayName> | ||
<div> | ||
<span | ||
data-testid="comp" | ||
> | ||
Chinese Yuan | ||
</span> | ||
</div> | ||
`; | ||
|
||
exports[`<FormattedDisplayName /> renders an empty <> when the underlying DisplayNames would return undefined 1`] = ` | ||
<FormattedDisplayName | ||
fallback="none" | ||
type="language" | ||
value="xx-XX" | ||
/> | ||
<div> | ||
<span | ||
data-testid="comp" | ||
/> | ||
</div> | ||
`; |
76 changes: 21 additions & 55 deletions
76
packages/react-intl/tests/unit/components/__snapshots__/message.tsx.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,75 +1,41 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`<FormattedMessage> accepts string as \`tagName\` prop 1`] = ` | ||
<div> | ||
<span | ||
data-testid="comp" | ||
> | ||
<p> | ||
Hello, World! | ||
</p> | ||
</span> | ||
</div> | ||
`; | ||
exports[`<FormattedMessage> rich text supports rich-text message formatting w/ nested tag 1`] = ` | ||
<FormattedMessage | ||
defaultMessage="Hello, <b>{name}<i>!</i></b>" | ||
id="hello" | ||
values={ | ||
Object { | ||
"b": [Function], | ||
"i": [Function], | ||
"name": "Jest", | ||
} | ||
} | ||
<span | ||
data-testid="comp" | ||
> | ||
Hello, | ||
<b | ||
key=".1" | ||
> | ||
<b> | ||
Jest | ||
<i | ||
key=".1" | ||
> | ||
<i> | ||
! | ||
</i> | ||
</b> | ||
</FormattedMessage> | ||
</span> | ||
`; | ||
exports[`<FormattedMessage> rich text supports rich-text message formatting w/ nested tag, chunks merged 1`] = ` | ||
<FormattedMessage | ||
defaultMessage="Hello, <b>{name}<i>!</i></b>" | ||
id="hello" | ||
values={ | ||
Object { | ||
"b": [Function], | ||
"i": [Function], | ||
"name": "Jest", | ||
} | ||
} | ||
<span | ||
data-testid="comp" | ||
> | ||
Hello, | ||
<b | ||
key=".1" | ||
> | ||
<b> | ||
Jest | ||
<i | ||
key=".1" | ||
> | ||
<i> | ||
! | ||
</i> | ||
</b> | ||
</FormattedMessage> | ||
`; | ||
exports[`<FormattedMessage> should work with mount enzyme 1`] = ` | ||
<span> | ||
<FormattedMessage | ||
id="foo" | ||
> | ||
hello foo | ||
</FormattedMessage> | ||
</span> | ||
`; | ||
exports[`<FormattedMessage> should work with shallow enzyme 1`] = ` | ||
<ContextConsumer> | ||
<Component /> | ||
</ContextConsumer> | ||
`; | ||
exports[`<FormattedMessage> should work with shallow enzyme 2`] = ` | ||
<Fragment> | ||
hello foo | ||
</Fragment> | ||
`; |
9 changes: 3 additions & 6 deletions
9
packages/react-intl/tests/unit/components/__snapshots__/relative.tsx.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,11 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`<FormattedRelativeTime> supports function-as-child pattern 1`] = ` | ||
<FormattedRelativeTime | ||
unit="second" | ||
value={0} | ||
<span | ||
data-testid="comp" | ||
> | ||
<b> | ||
Jest | ||
</b> | ||
</FormattedRelativeTime> | ||
</span> | ||
`; | ||
exports[`<FormattedRelativeTime> throws an error for invalid unit 1`] = `"FORMAT_ERROR"`; |
Oops, something went wrong.