Files
cadhub/web/src/components/PartReactionsCell/PartReactionsCell.test.js
Kurt Hutten 9db76458d1 Revert "Move app into app directory"
This reverts commit 5c53902caf.
2021-05-01 07:29:45 +10:00

27 lines
882 B
JavaScript

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()
})
})