diff options
Diffstat (limited to 'app/javascript/mastodon/components/__tests__/autosuggest_emoji-test.js')
-rw-r--r-- | app/javascript/mastodon/components/__tests__/autosuggest_emoji-test.js | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/app/javascript/mastodon/components/__tests__/autosuggest_emoji-test.js b/app/javascript/mastodon/components/__tests__/autosuggest_emoji-test.js new file mode 100644 index 000000000..05616e444 --- /dev/null +++ b/app/javascript/mastodon/components/__tests__/autosuggest_emoji-test.js @@ -0,0 +1,29 @@ +import React from 'react'; +import renderer from 'react-test-renderer'; +import AutosuggestEmoji from '../autosuggest_emoji'; + +describe('<AutosuggestEmoji />', () => { + it('renders native emoji', () => { + const emoji = { + native: '💙', + colons: ':foobar:', + }; + const component = renderer.create(<AutosuggestEmoji emoji={emoji} />); + const tree = component.toJSON(); + + expect(tree).toMatchSnapshot(); + }); + + it('renders emoji with custom url', () => { + const emoji = { + custom: true, + imageUrl: 'http://example.com/emoji.png', + native: 'foobar', + colons: ':foobar:', + }; + const component = renderer.create(<AutosuggestEmoji emoji={emoji} />); + const tree = component.toJSON(); + + expect(tree).toMatchSnapshot(); + }); +}); |