diff options
author | Vitaly Takmazov | 2018-06-21 10:13:12 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2023-01-13 10:37:53 +0300 |
commit | 114792eeff9a9887214eadd2224386e314438cd6 (patch) | |
tree | 7e2f25f5056f1b2b2fb60baf577c7d54de841440 /vnext/src/components/__tests__ | |
parent | b257e179862d0b895d6e7be30136018515de564c (diff) |
Clear message input on send
Diffstat (limited to 'vnext/src/components/__tests__')
-rw-r--r-- | vnext/src/components/__tests__/MessageInput-test.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/vnext/src/components/__tests__/MessageInput-test.js b/vnext/src/components/__tests__/MessageInput-test.js index f6a452d8..a348a639 100644 --- a/vnext/src/components/__tests__/MessageInput-test.js +++ b/vnext/src/components/__tests__/MessageInput-test.js @@ -44,4 +44,11 @@ it('Submits on ctrl-enter', () => { ctrlKey: true }); expect(onSend).toHaveBeenCalledTimes(1); -});
\ No newline at end of file +}); + +it('Clears template on submit', () => { + const messageInput = mount(<MessageInput data={testMessage} onSend={() => {}} />); + messageInput.setState({'body': 'yoyo'}); + messageInput.find('.msg-comment .badge').simulate('click'); + expect(messageInput.state().body).toEqual(''); +}) |