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

Commit

Permalink
Update test helpers and related tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cometkim committed Oct 3, 2019
1 parent 67dbfc1 commit 96ae6cc
Show file tree
Hide file tree
Showing 191 changed files with 2,926 additions and 3,182 deletions.
92 changes: 60 additions & 32 deletions components/__snapshots__/formatted_markdown_message.test.jsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

exports[`components/FormattedMarkdownMessage should backup to default 1`] = `
<IntlProvider
defaultFormats={Object {}}
defaultLocale="en"
formats={Object {}}
locale="en"
messages={
Object {
Expand All @@ -10,8 +13,10 @@ exports[`components/FormattedMarkdownMessage should backup to default 1`] = `
"test.vals": "*Hi* {petName}!",
}
}
onError={[Function]}
textComponent={Symbol(react.fragment)}
>
<InjectIntl(FormattedMarkdownMessage)
<injectIntl(FormattedMarkdownMessage)
defaultMessage="testing default message"
id="xxx"
>
Expand All @@ -23,30 +28,32 @@ exports[`components/FormattedMarkdownMessage should backup to default 1`] = `
"defaultFormats": Object {},
"defaultLocale": "en",
"formatDate": [Function],
"formatDateToParts": [Function],
"formatHTMLMessage": [Function],
"formatMessage": [Function],
"formatNumber": [Function],
"formatNumberToParts": [Function],
"formatPlural": [Function],
"formatRelative": [Function],
"formatRelativeTime": [Function],
"formatTime": [Function],
"formatTimeToParts": [Function],
"formats": Object {},
"formatters": Object {
"getDateTimeFormat": [Function],
"getMessageFormat": [Function],
"getNumberFormat": [Function],
"getPluralFormat": [Function],
"getRelativeFormat": [Function],
"getPluralRules": [Function],
"getRelativeTimeFormat": [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,
"textComponent": Symbol(react.fragment),
"timeZone": undefined,
}
}
>
Expand All @@ -58,12 +65,15 @@ exports[`components/FormattedMarkdownMessage should backup to default 1`] = `
}
/>
</FormattedMarkdownMessage>
</InjectIntl(FormattedMarkdownMessage)>
</injectIntl(FormattedMarkdownMessage)>
</IntlProvider>
`;

exports[`components/FormattedMarkdownMessage should escape non-BR 1`] = `
<IntlProvider
defaultFormats={Object {}}
defaultLocale="en"
formats={Object {}}
locale="en"
messages={
Object {
Expand All @@ -72,8 +82,10 @@ exports[`components/FormattedMarkdownMessage should escape non-BR 1`] = `
"test.vals": "*Hi* {petName}!",
}
}
onError={[Function]}
textComponent={Symbol(react.fragment)}
>
<InjectIntl(FormattedMarkdownMessage)
<injectIntl(FormattedMarkdownMessage)
defaultMessage=""
id="test.bar"
>
Expand All @@ -85,30 +97,32 @@ exports[`components/FormattedMarkdownMessage should escape non-BR 1`] = `
"defaultFormats": Object {},
"defaultLocale": "en",
"formatDate": [Function],
"formatDateToParts": [Function],
"formatHTMLMessage": [Function],
"formatMessage": [Function],
"formatNumber": [Function],
"formatNumberToParts": [Function],
"formatPlural": [Function],
"formatRelative": [Function],
"formatRelativeTime": [Function],
"formatTime": [Function],
"formatTimeToParts": [Function],
"formats": Object {},
"formatters": Object {
"getDateTimeFormat": [Function],
"getMessageFormat": [Function],
"getNumberFormat": [Function],
"getPluralFormat": [Function],
"getRelativeFormat": [Function],
"getPluralRules": [Function],
"getRelativeTimeFormat": [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,
"textComponent": Symbol(react.fragment),
"timeZone": undefined,
}
}
>
Expand All @@ -120,12 +134,15 @@ exports[`components/FormattedMarkdownMessage should escape non-BR 1`] = `
}
/>
</FormattedMarkdownMessage>
</InjectIntl(FormattedMarkdownMessage)>
</injectIntl(FormattedMarkdownMessage)>
</IntlProvider>
`;

exports[`components/FormattedMarkdownMessage should render message 1`] = `
<IntlProvider
defaultFormats={Object {}}
defaultLocale="en"
formats={Object {}}
locale="en"
messages={
Object {
Expand All @@ -134,8 +151,10 @@ exports[`components/FormattedMarkdownMessage should render message 1`] = `
"test.vals": "*Hi* {petName}!",
}
}
onError={[Function]}
textComponent={Symbol(react.fragment)}
>
<InjectIntl(FormattedMarkdownMessage)
<injectIntl(FormattedMarkdownMessage)
defaultMessage="**bold** *italic* [link](https://mattermost.com/) <br/> [link target blank](!https://mattermost.com/)"
id="test.foo"
>
Expand All @@ -147,30 +166,32 @@ exports[`components/FormattedMarkdownMessage should render message 1`] = `
"defaultFormats": Object {},
"defaultLocale": "en",
"formatDate": [Function],
"formatDateToParts": [Function],
"formatHTMLMessage": [Function],
"formatMessage": [Function],
"formatNumber": [Function],
"formatNumberToParts": [Function],
"formatPlural": [Function],
"formatRelative": [Function],
"formatRelativeTime": [Function],
"formatTime": [Function],
"formatTimeToParts": [Function],
"formats": Object {},
"formatters": Object {
"getDateTimeFormat": [Function],
"getMessageFormat": [Function],
"getNumberFormat": [Function],
"getPluralFormat": [Function],
"getRelativeFormat": [Function],
"getPluralRules": [Function],
"getRelativeTimeFormat": [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,
"textComponent": Symbol(react.fragment),
"timeZone": undefined,
}
}
>
Expand All @@ -182,12 +203,15 @@ exports[`components/FormattedMarkdownMessage should render message 1`] = `
}
/>
</FormattedMarkdownMessage>
</InjectIntl(FormattedMarkdownMessage)>
</injectIntl(FormattedMarkdownMessage)>
</IntlProvider>
`;

exports[`components/FormattedMarkdownMessage values should work 1`] = `
<IntlProvider
defaultFormats={Object {}}
defaultLocale="en"
formats={Object {}}
locale="en"
messages={
Object {
Expand All @@ -196,8 +220,10 @@ exports[`components/FormattedMarkdownMessage values should work 1`] = `
"test.vals": "*Hi* {petName}!",
}
}
onError={[Function]}
textComponent={Symbol(react.fragment)}
>
<InjectIntl(FormattedMarkdownMessage)
<injectIntl(FormattedMarkdownMessage)
defaultMessage="*Hi* {petName}!"
id="test.vals"
values={
Expand All @@ -214,30 +240,32 @@ exports[`components/FormattedMarkdownMessage values should work 1`] = `
"defaultFormats": Object {},
"defaultLocale": "en",
"formatDate": [Function],
"formatDateToParts": [Function],
"formatHTMLMessage": [Function],
"formatMessage": [Function],
"formatNumber": [Function],
"formatNumberToParts": [Function],
"formatPlural": [Function],
"formatRelative": [Function],
"formatRelativeTime": [Function],
"formatTime": [Function],
"formatTimeToParts": [Function],
"formats": Object {},
"formatters": Object {
"getDateTimeFormat": [Function],
"getMessageFormat": [Function],
"getNumberFormat": [Function],
"getPluralFormat": [Function],
"getRelativeFormat": [Function],
"getPluralRules": [Function],
"getRelativeTimeFormat": [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,
"textComponent": Symbol(react.fragment),
"timeZone": undefined,
}
}
values={
Expand All @@ -254,6 +282,6 @@ exports[`components/FormattedMarkdownMessage values should work 1`] = `
}
/>
</FormattedMarkdownMessage>
</InjectIntl(FormattedMarkdownMessage)>
</injectIntl(FormattedMarkdownMessage)>
</IntlProvider>
`;
8 changes: 2 additions & 6 deletions components/__snapshots__/loading_image_preview.test.jsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ exports[`components/LoadingImagePreview should match snapshot 1`] = `
<div
className="view-image__loading"
>
<LoadingSpinner
text={null}
/>
<injectIntl(LoadingSpinner) />
<span
className="loader-percent"
>
Expand All @@ -19,9 +17,7 @@ exports[`components/LoadingImagePreview should match snapshot 2`] = `
<div
className="view-image__loading"
>
<LoadingSpinner
text={null}
/>
<injectIntl(LoadingSpinner) />
<span
className="loader-percent"
>
Expand Down
4 changes: 1 addition & 3 deletions components/__snapshots__/pdf_preview.test.jsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ exports[`component/PDFPreview should match snapshot, loading 1`] = `
<div
className="view-image__loading"
>
<LoadingSpinner
text={null}
/>
<injectIntl(LoadingSpinner) />
</div>
`;

Expand Down
2 changes: 1 addition & 1 deletion components/__snapshots__/profile_picture.test.jsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ exports[`components/ProfilePicture should match snapshot, profile and src, defau
<OverlayTrigger
defaultOverlayShown={false}
overlay={
<Connect(InjectIntl(ProfilePopover))
<Connect(injectIntl(ProfilePopover))
hasMention={false}
hide={[Function]}
isBusy={true}
Expand Down
Loading

0 comments on commit 96ae6cc

Please sign in to comment.