Add tests from custom reacts
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
parent
09a0a36935
commit
38c99dbc48
1 changed files with 24 additions and 0 deletions
|
@ -193,6 +193,18 @@ describe('simulateEmojiReact', () => {
|
|||
{ 'count': 1, 'me': true, 'name': '😯', 'url': undefined },
|
||||
]));
|
||||
});
|
||||
|
||||
it('adds a custom emoji to the list', () => {
|
||||
const emojiReacts = fromJS([
|
||||
{ 'count': 2, 'me': false, 'name': '👍', 'url': undefined },
|
||||
{ 'count': 2, 'me': false, 'name': '❤', 'url': undefined },
|
||||
]) as ImmutableList<ImmutableMap<string, any>>;
|
||||
expect(simulateEmojiReact(emojiReacts, 'soapbox', 'https://gleasonator.com/emoji/Gleasonator/soapbox.png')).toEqual(fromJS([
|
||||
{ 'count': 2, 'me': false, 'name': '👍', 'url': undefined },
|
||||
{ 'count': 2, 'me': false, 'name': '❤', 'url': undefined },
|
||||
{ 'count': 1, 'me': true, 'name': 'soapbox', 'url': 'https://gleasonator.com/emoji/Gleasonator/soapbox.png' },
|
||||
]));
|
||||
});
|
||||
});
|
||||
|
||||
describe('simulateUnEmojiReact', () => {
|
||||
|
@ -218,4 +230,16 @@ describe('simulateUnEmojiReact', () => {
|
|||
{ 'count': 2, 'me': false, 'name': '❤' },
|
||||
]));
|
||||
});
|
||||
|
||||
it ('removes custom emoji from the list', () => {
|
||||
const emojiReacts = fromJS([
|
||||
{ 'count': 2, 'me': false, 'name': '👍' },
|
||||
{ 'count': 2, 'me': false, 'name': '❤' },
|
||||
{ 'count': 1, 'me': true, 'name': 'soapbox', 'url': 'https://gleasonator.com/emoji/Gleasonator/soapbox.png' },
|
||||
]) as ImmutableList<ImmutableMap<string, any>>;
|
||||
expect(simulateUnEmojiReact(emojiReacts, 'soapbox')).toEqual(fromJS([
|
||||
{ 'count': 2, 'me': false, 'name': '👍' },
|
||||
{ 'count': 2, 'me': false, 'name': '❤' },
|
||||
]));
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue