mirror of
https://github.com/darkwire/darkwire.io.git
synced 2025-07-22 20:51:28 +00:00
* Auto-detect lang * Fix Chat test * Default language to empty string Co-authored-by: Alan Friedman <d.alan.friedman@gmail.com>
18 lines
559 B
JavaScript
18 lines
559 B
JavaScript
import React from 'react'
|
|
import { mount } from 'enzyme'
|
|
import toJson from 'enzyme-to-json'
|
|
import { Chat } from './index.js'
|
|
|
|
const sendEncryptedMessage = jest.fn()
|
|
|
|
test('Chat Component', () => {
|
|
const component = mount(
|
|
<Chat scrollToBottom={() => {}} focusChat={false} userId="foo" username="user" showNotice={() => {}} clearActivities={() => {}} sendEncryptedMessage={sendEncryptedMessage} translations={{}}/>
|
|
)
|
|
|
|
const componentJSON = toJson(component)
|
|
|
|
expect(component).toMatchSnapshot()
|
|
expect(componentJSON.children.length).toBe(1)
|
|
})
|