fix tests

This commit is contained in:
Sharon Kennedy
2020-03-27 18:21:13 -04:00
parent 3fd9c7365d
commit 3f2aa3a9db
8 changed files with 65 additions and 9 deletions

View File

@@ -471,8 +471,6 @@ class ChatBox extends React.Component {
handleSubmit = e => {
e.preventDefault()
const message = this.state.inputValue
console.log('event', e)
console.log('message', message)
if (!Boolean(message)) return null;
if (this.state.client && this.state.roomId) {

View File

@@ -21,24 +21,24 @@ import { createWaitForElement } from 'enzyme-wait';
import { config } from 'react-transition-group';
import waitForExpect from 'wait-for-expect'
config.disabled = true
const testConfig = {
var testConfig = {
matrixServerUrl: 'https://matrix.rhok.space',
botUsername: '@help-bot:rhok.space',
botId: '@help-bot:rhok.space',
roomName: 'Support Chat',
termsUrl: 'https://tosdr.org/',
introMessage: 'This chat application does not collect any of your personal data or any data from your use of this service.',
agreementMessage: '👉 Do you want to continue? Type yes or no.',
agreementMessage: 'Do you want to continue?',
confirmationMessage: 'Waiting for a facilitator to join the chat...',
exitMessage: 'The chat was not started.',
exitMessage: 'The chat is closed. You may close this window.',
chatUnavailableMessage: 'The chat service is not available right now. Please try again later.',
anonymousDisplayName: 'Anonymous',
}
describe('Chatbox', () => {
beforeEach(() => {
createClient.mockClear()
mockInitCrypto.mockClear()
@@ -52,6 +52,7 @@ describe('Chatbox', () => {
mockClearStores.mockClear()
mockOnce.mockClear()
mockOn.mockClear()
mockSendTextMessage.mockClear()
})
test('chat window should open and close', async () => {

View File

@@ -28,7 +28,10 @@ class EmojiSelector extends React.Component {
status => {
return(
<div className={`emoji-picker emoji-picker-${status}`} aria-hidden={!emojiSelectorOpen}>
<EmojiPicker onEmojiClick={onEmojiClick} />
<EmojiPicker
onEmojiClick={onEmojiClick}
emojiUrl="https://cdn.jsdelivr.net/gh/iamcal/emoji-data@master/img-apple-64"
/>
</div>
)
}