This repository has been archived by the owner on Mar 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MM-12449 Migrate 'components/file_upload_overlay.jsx' and associated …
…tests to TypeScript (#3919)
- Loading branch information
1 parent
4fb5a5a
commit 84f9f6c
Showing
5 changed files
with
171 additions
and
10 deletions.
There are no files selected for viewing
121 changes: 121 additions & 0 deletions
121
components/__snapshots__/file_upload_overlay.test.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 |
---|---|---|
@@ -0,0 +1,121 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`components/FileUploadOverlay should match snapshot when file upload is showing with no overlay type 1`] = ` | ||
<div | ||
className="file-overlay hidden" | ||
> | ||
<div | ||
className="overlay__indent" | ||
> | ||
<div | ||
className="overlay__circle" | ||
> | ||
<img | ||
alt="Files" | ||
className="overlay__files" | ||
src={null} | ||
/> | ||
<span> | ||
<FormattedMessage | ||
defaultMessage="Upload Icon" | ||
id="generic_icons.upload" | ||
values={Object {}} | ||
> | ||
<Component /> | ||
</FormattedMessage> | ||
<FormattedMessage | ||
defaultMessage="Drop a file to upload it." | ||
id="upload_overlay.info" | ||
values={Object {}} | ||
/> | ||
</span> | ||
<img | ||
alt="Logo" | ||
className="overlay__logo" | ||
src={null} | ||
width="100" | ||
/> | ||
</div> | ||
</div> | ||
</div> | ||
`; | ||
|
||
exports[`components/FileUploadOverlay should match snapshot when file upload is showing with overlay type of center 1`] = ` | ||
<div | ||
className="file-overlay hidden center-file-overlay" | ||
> | ||
<div | ||
className="overlay__indent" | ||
> | ||
<div | ||
className="overlay__circle" | ||
> | ||
<img | ||
alt="Files" | ||
className="overlay__files" | ||
src={null} | ||
/> | ||
<span> | ||
<FormattedMessage | ||
defaultMessage="Upload Icon" | ||
id="generic_icons.upload" | ||
values={Object {}} | ||
> | ||
<Component /> | ||
</FormattedMessage> | ||
<FormattedMessage | ||
defaultMessage="Drop a file to upload it." | ||
id="upload_overlay.info" | ||
values={Object {}} | ||
/> | ||
</span> | ||
<img | ||
alt="Logo" | ||
className="overlay__logo" | ||
src={null} | ||
width="100" | ||
/> | ||
</div> | ||
</div> | ||
</div> | ||
`; | ||
|
||
exports[`components/FileUploadOverlay should match snapshot when file upload is showing with overlay type of right 1`] = ` | ||
<div | ||
className="file-overlay hidden right-file-overlay" | ||
> | ||
<div | ||
className="overlay__indent" | ||
> | ||
<div | ||
className="overlay__circle" | ||
> | ||
<img | ||
alt="Files" | ||
className="overlay__files" | ||
src={null} | ||
/> | ||
<span> | ||
<FormattedMessage | ||
defaultMessage="Upload Icon" | ||
id="generic_icons.upload" | ||
values={Object {}} | ||
> | ||
<Component /> | ||
</FormattedMessage> | ||
<FormattedMessage | ||
defaultMessage="Drop a file to upload it." | ||
id="upload_overlay.info" | ||
values={Object {}} | ||
/> | ||
</span> | ||
<img | ||
alt="Logo" | ||
className="overlay__logo" | ||
src={null} | ||
width="100" | ||
/> | ||
</div> | ||
</div> | ||
</div> | ||
`; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. | ||
// See LICENSE.txt for license information. | ||
|
||
import React from 'react'; | ||
import {shallow} from 'enzyme'; | ||
|
||
import FileUploadOverlay from 'components/file_upload_overlay'; | ||
|
||
describe('components/FileUploadOverlay', () => { | ||
test('should match snapshot when file upload is showing with no overlay type', () => { | ||
const wrapper = shallow( | ||
<FileUploadOverlay | ||
overlayType='' | ||
/> | ||
); | ||
|
||
expect(wrapper).toMatchSnapshot(); | ||
}); | ||
|
||
test('should match snapshot when file upload is showing with overlay type of right', () => { | ||
const wrapper = shallow( | ||
<FileUploadOverlay | ||
overlayType='right' | ||
/> | ||
); | ||
|
||
expect(wrapper).toMatchSnapshot(); | ||
}); | ||
|
||
test('should match snapshot when file upload is showing with overlay type of center', () => { | ||
const wrapper = shallow( | ||
<FileUploadOverlay | ||
overlayType='center' | ||
/> | ||
); | ||
|
||
expect(wrapper).toMatchSnapshot(); | ||
}); | ||
}); |
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