reactions cells

This commit is contained in:
Yen Colon
2021-01-15 10:25:28 -04:00
parent fd2524469d
commit 26235158fa
4 changed files with 74 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
import { render, screen } from '@redwoodjs/testing'
import { Loading, Empty, Failure, Success } from './PartReactionsCell'
import { standard } from './PartReactionsCell.mock'
describe('PartReactionsCell', () => {
test('Loading renders successfully', () => {
render(<Loading />)
// Use screen.debug() to see output
expect(screen.getByText('Loading...')).toBeInTheDocument()
})
test('Empty renders successfully', async () => {
render(<Empty />)
expect(screen.getByText('Empty')).toBeInTheDocument()
})
test('Failure renders successfully', async () => {
render(<Failure error={new Error('Oh no')} />)
expect(screen.getByText(/Oh no/i)).toBeInTheDocument()
})
test('Success renders successfully', async () => {
render(<Success partReactions={standard().partReactions} />)
expect(screen.getByText(/42/i)).toBeInTheDocument()
})
})