Add basic part page

This commit is contained in:
Kurt Hutten
2020-10-16 16:43:29 +11:00
parent 0d64d98d55
commit 2df4ac0d57
12 changed files with 559 additions and 48 deletions

View File

@@ -0,0 +1,26 @@
import { render, screen } from '@redwoodjs/testing'
import { Loading, Empty, Failure, Success } from './IdePartCell'
import { standard } from './IdePartCell.mock'
describe('IdePartCell', () => {
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 idePart={standard().idePart} />)
expect(screen.getByText(/42/i)).toBeInTheDocument()
})
})