Skip to content
This repository was archived by the owner on Mar 13, 2024. It is now read-only.

Commit

Permalink
MM-20259 Revert react-intl upgrade (#4255)
Browse files Browse the repository at this point in the history
* MM-20259 Revert react-intl upgrade

* Fix type issues

* Fix FullScreenModal snapshots

* Fix snapshot for MenuItemToggleModalRedux

* Address feedback

* Update snapshots
  • Loading branch information
hmhealey authored and enahum committed Nov 20, 2019
1 parent 023fb47 commit d698954
Show file tree
Hide file tree
Showing 190 changed files with 2,931 additions and 3,133 deletions.
259 changes: 259 additions & 0 deletions components/__snapshots__/formatted_markdown_message.test.jsx.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,259 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`components/FormattedMarkdownMessage should backup to default 1`] = `
<IntlProvider
locale="en"
messages={
Object {
"test.bar": "<b>hello</b> <script>var malicious = true;</script> world!",
"test.foo": "**bold** *italic* [link](https://mattermost.com/) <br/> [link target blank](!https://mattermost.com/)",
"test.vals": "*Hi* {petName}!",
}
}
>
<InjectIntl(FormattedMarkdownMessage)
defaultMessage="testing default message"
id="xxx"
>
<FormattedMarkdownMessage
defaultMessage="testing default message"
id="xxx"
intl={
Object {
"defaultFormats": Object {},
"defaultLocale": "en",
"formatDate": [Function],
"formatHTMLMessage": [Function],
"formatMessage": [Function],
"formatNumber": [Function],
"formatPlural": [Function],
"formatRelative": [Function],
"formatTime": [Function],
"formats": Object {},
"formatters": Object {
"getDateTimeFormat": [Function],
"getMessageFormat": [Function],
"getNumberFormat": [Function],
"getPluralFormat": [Function],
"getRelativeFormat": [Function],
},
"locale": "en",
"messages": Object {
"test.bar": "<b>hello</b> <script>var malicious = true;</script> world!",
"test.foo": "**bold** *italic* [link](https://mattermost.com/) <br/> [link target blank](!https://mattermost.com/)",
"test.vals": "*Hi* {petName}!",
},
"now": [Function],
"onError": [Function],
"textComponent": "span",
"timeZone": null,
}
}
>
<span
dangerouslySetInnerHTML={
Object {
"__html": "testing default message",
}
}
/>
</FormattedMarkdownMessage>
</InjectIntl(FormattedMarkdownMessage)>
</IntlProvider>
`;

exports[`components/FormattedMarkdownMessage should escape non-BR 1`] = `
<IntlProvider
locale="en"
messages={
Object {
"test.bar": "<b>hello</b> <script>var malicious = true;</script> world!",
"test.foo": "**bold** *italic* [link](https://mattermost.com/) <br/> [link target blank](!https://mattermost.com/)",
"test.vals": "*Hi* {petName}!",
}
}
>
<InjectIntl(FormattedMarkdownMessage)
defaultMessage=""
id="test.bar"
>
<FormattedMarkdownMessage
defaultMessage=""
id="test.bar"
intl={
Object {
"defaultFormats": Object {},
"defaultLocale": "en",
"formatDate": [Function],
"formatHTMLMessage": [Function],
"formatMessage": [Function],
"formatNumber": [Function],
"formatPlural": [Function],
"formatRelative": [Function],
"formatTime": [Function],
"formats": Object {},
"formatters": Object {
"getDateTimeFormat": [Function],
"getMessageFormat": [Function],
"getNumberFormat": [Function],
"getPluralFormat": [Function],
"getRelativeFormat": [Function],
},
"locale": "en",
"messages": Object {
"test.bar": "<b>hello</b> <script>var malicious = true;</script> world!",
"test.foo": "**bold** *italic* [link](https://mattermost.com/) <br/> [link target blank](!https://mattermost.com/)",
"test.vals": "*Hi* {petName}!",
},
"now": [Function],
"onError": [Function],
"textComponent": "span",
"timeZone": null,
}
}
>
<span
dangerouslySetInnerHTML={
Object {
"__html": "&lt;b&gt;hello&lt;/b&gt; &lt;script&gt;var malicious = true;&lt;/script&gt; world!",
}
}
/>
</FormattedMarkdownMessage>
</InjectIntl(FormattedMarkdownMessage)>
</IntlProvider>
`;

exports[`components/FormattedMarkdownMessage should render message 1`] = `
<IntlProvider
locale="en"
messages={
Object {
"test.bar": "<b>hello</b> <script>var malicious = true;</script> world!",
"test.foo": "**bold** *italic* [link](https://mattermost.com/) <br/> [link target blank](!https://mattermost.com/)",
"test.vals": "*Hi* {petName}!",
}
}
>
<InjectIntl(FormattedMarkdownMessage)
defaultMessage="**bold** *italic* [link](https://mattermost.com/) <br/> [link target blank](!https://mattermost.com/)"
id="test.foo"
>
<FormattedMarkdownMessage
defaultMessage="**bold** *italic* [link](https://mattermost.com/) <br/> [link target blank](!https://mattermost.com/)"
id="test.foo"
intl={
Object {
"defaultFormats": Object {},
"defaultLocale": "en",
"formatDate": [Function],
"formatHTMLMessage": [Function],
"formatMessage": [Function],
"formatNumber": [Function],
"formatPlural": [Function],
"formatRelative": [Function],
"formatTime": [Function],
"formats": Object {},
"formatters": Object {
"getDateTimeFormat": [Function],
"getMessageFormat": [Function],
"getNumberFormat": [Function],
"getPluralFormat": [Function],
"getRelativeFormat": [Function],
},
"locale": "en",
"messages": Object {
"test.bar": "<b>hello</b> <script>var malicious = true;</script> world!",
"test.foo": "**bold** *italic* [link](https://mattermost.com/) <br/> [link target blank](!https://mattermost.com/)",
"test.vals": "*Hi* {petName}!",
},
"now": [Function],
"onError": [Function],
"textComponent": "span",
"timeZone": null,
}
}
>
<span
dangerouslySetInnerHTML={
Object {
"__html": "<strong>bold</strong> <em>italic</em> <a href=\\"https://mattermost.com/\\">link</a> &lt;br/&gt; <a href=\\"https://mattermost.com/\\" rel=\\"noreferrer\\" target=\\"_blank\\">link target blank</a>",
}
}
/>
</FormattedMarkdownMessage>
</InjectIntl(FormattedMarkdownMessage)>
</IntlProvider>
`;

exports[`components/FormattedMarkdownMessage values should work 1`] = `
<IntlProvider
locale="en"
messages={
Object {
"test.bar": "<b>hello</b> <script>var malicious = true;</script> world!",
"test.foo": "**bold** *italic* [link](https://mattermost.com/) <br/> [link target blank](!https://mattermost.com/)",
"test.vals": "*Hi* {petName}!",
}
}
>
<InjectIntl(FormattedMarkdownMessage)
defaultMessage="*Hi* {petName}!"
id="test.vals"
values={
Object {
"petName": "sweetie",
}
}
>
<FormattedMarkdownMessage
defaultMessage="*Hi* {petName}!"
id="test.vals"
intl={
Object {
"defaultFormats": Object {},
"defaultLocale": "en",
"formatDate": [Function],
"formatHTMLMessage": [Function],
"formatMessage": [Function],
"formatNumber": [Function],
"formatPlural": [Function],
"formatRelative": [Function],
"formatTime": [Function],
"formats": Object {},
"formatters": Object {
"getDateTimeFormat": [Function],
"getMessageFormat": [Function],
"getNumberFormat": [Function],
"getPluralFormat": [Function],
"getRelativeFormat": [Function],
},
"locale": "en",
"messages": Object {
"test.bar": "<b>hello</b> <script>var malicious = true;</script> world!",
"test.foo": "**bold** *italic* [link](https://mattermost.com/) <br/> [link target blank](!https://mattermost.com/)",
"test.vals": "*Hi* {petName}!",
},
"now": [Function],
"onError": [Function],
"textComponent": "span",
"timeZone": null,
}
}
values={
Object {
"petName": "sweetie",
}
}
>
<span
dangerouslySetInnerHTML={
Object {
"__html": "<em>Hi</em> sweetie!",
}
}
/>
</FormattedMarkdownMessage>
</InjectIntl(FormattedMarkdownMessage)>
</IntlProvider>
`;
Loading

0 comments on commit d698954

Please sign in to comment.