mirror of
https://github.com/overleaf/overleaf.git
synced 2024-10-24 21:12:38 -04:00
7c97f8ab6e
* Use new JSX runtime and update Babel Node target * Update .eslintrc * Remove React imports GitOrigin-RevId: 559de0267f8f2934c56a860ea8701bb522aa861a
26 lines
795 B
JavaScript
26 lines
795 B
JavaScript
import { expect } from 'chai'
|
|
import { render, screen } from '@testing-library/react'
|
|
|
|
import ChatToggleButton from '../../../../../frontend/js/features/editor-navigation-toolbar/components/chat-toggle-button'
|
|
|
|
describe('<ChatToggleButton />', function () {
|
|
const defaultProps = {
|
|
chatIsOpen: false,
|
|
unreadMessageCount: 0,
|
|
onClick: () => {},
|
|
}
|
|
|
|
it('displays the number of unread messages', function () {
|
|
const props = {
|
|
...defaultProps,
|
|
unreadMessageCount: 113,
|
|
}
|
|
render(<ChatToggleButton {...props} />)
|
|
screen.getByText('113')
|
|
})
|
|
|
|
it("doesn't display the unread messages badge when the number of unread messages is zero", function () {
|
|
render(<ChatToggleButton {...defaultProps} />)
|
|
expect(screen.queryByText('0')).to.not.exist
|
|
})
|
|
})
|