-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'mattermost:main' into android-theme
- Loading branch information
Showing
68 changed files
with
7,958 additions
and
51 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
135 changes: 135 additions & 0 deletions
135
..._list/post/body/content/message_attachments/__snapshots__/attachment_author.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,135 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`AttachmentAuthor it matches snapshot when both name and icon are provided 1`] = ` | ||
<View | ||
style={ | ||
{ | ||
"flex": 1, | ||
"flexDirection": "row", | ||
} | ||
} | ||
> | ||
<View | ||
style={ | ||
[ | ||
{ | ||
"overflow": "hidden", | ||
}, | ||
{ | ||
"height": 12, | ||
"marginRight": 3, | ||
"width": 12, | ||
}, | ||
] | ||
} | ||
> | ||
<FastImageView | ||
defaultSource={null} | ||
resizeMode="cover" | ||
source={ | ||
{ | ||
"uri": "https://images.com/image.png", | ||
} | ||
} | ||
style={ | ||
{ | ||
"bottom": 0, | ||
"left": 0, | ||
"position": "absolute", | ||
"right": 0, | ||
"top": 0, | ||
} | ||
} | ||
/> | ||
</View> | ||
<Text | ||
onPress={[Function]} | ||
style={ | ||
[ | ||
{ | ||
"color": "rgba(63,67,80,0.5)", | ||
"fontSize": 11, | ||
}, | ||
{ | ||
"color": "rgba(28,88,217,0.5)", | ||
}, | ||
] | ||
} | ||
> | ||
jhondoe | ||
</Text> | ||
</View> | ||
`; | ||
|
||
exports[`AttachmentAuthor it matches snapshot when only icon is provided 1`] = ` | ||
<View | ||
style={ | ||
{ | ||
"flex": 1, | ||
"flexDirection": "row", | ||
} | ||
} | ||
> | ||
<View | ||
style={ | ||
[ | ||
{ | ||
"overflow": "hidden", | ||
}, | ||
{ | ||
"height": 12, | ||
"marginRight": 3, | ||
"width": 12, | ||
}, | ||
] | ||
} | ||
> | ||
<FastImageView | ||
defaultSource={null} | ||
resizeMode="cover" | ||
source={ | ||
{ | ||
"uri": "https://images.com/image.png", | ||
} | ||
} | ||
style={ | ||
{ | ||
"bottom": 0, | ||
"left": 0, | ||
"position": "absolute", | ||
"right": 0, | ||
"top": 0, | ||
} | ||
} | ||
/> | ||
</View> | ||
</View> | ||
`; | ||
|
||
exports[`AttachmentAuthor it matches snapshot when only name is provided 1`] = ` | ||
<View | ||
style={ | ||
{ | ||
"flex": 1, | ||
"flexDirection": "row", | ||
} | ||
} | ||
> | ||
<Text | ||
onPress={[Function]} | ||
style={ | ||
[ | ||
{ | ||
"color": "rgba(63,67,80,0.5)", | ||
"fontSize": 11, | ||
}, | ||
{ | ||
"color": "rgba(28,88,217,0.5)", | ||
}, | ||
] | ||
} | ||
> | ||
jhondoe | ||
</Text> | ||
</View> | ||
`; |
43 changes: 43 additions & 0 deletions
43
app/components/post_list/post/body/content/message_attachments/attachment_author.test.tsx
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,43 @@ | ||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. | ||
// See LICENSE.txt for license information. | ||
|
||
import React from 'react'; | ||
|
||
import Preferences from '@constants/preferences'; | ||
import {renderWithIntl} from '@test/intl-test-helper'; | ||
|
||
import AttachmentAuthor from './attachment_author'; | ||
|
||
describe('AttachmentAuthor', () => { | ||
const baseProps = { | ||
link: 'http://linktoatachment.com', | ||
name: 'jhondoe', | ||
icon: 'https://images.com/image.png', | ||
theme: Preferences.THEMES.denim, | ||
}; | ||
|
||
test('it matches snapshot when both name and icon are provided', () => { | ||
const wrapper = renderWithIntl(<AttachmentAuthor {...baseProps}/>); | ||
expect(wrapper.toJSON()).toMatchSnapshot(); | ||
}); | ||
|
||
test('it matches snapshot when only name is provided', () => { | ||
const props = { | ||
...baseProps, | ||
icon: undefined, | ||
}; | ||
|
||
const wrapper = renderWithIntl(<AttachmentAuthor {...props}/>); | ||
expect(wrapper.toJSON()).toMatchSnapshot(); | ||
}); | ||
|
||
test('it matches snapshot when only icon is provided', () => { | ||
const props = { | ||
...baseProps, | ||
name: undefined, | ||
}; | ||
|
||
const wrapper = renderWithIntl(<AttachmentAuthor {...props}/>); | ||
expect(wrapper.toJSON()).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
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
Oops, something went wrong.