1
0
mirror of https://github.com/oceanprotocol/commons.git synced 2023-03-15 18:03:00 +01:00
commons/client/src/components/atoms/Form/Label.test.tsx

21 lines
633 B
TypeScript
Raw Normal View History

2019-04-30 19:19:28 +02:00
import React from 'react'
import { render } from 'react-testing-library'
import Label from './Label'
describe('Label', () => {
it('renders without crashing', () => {
const { container } = render(<Label htmlFor="hello">Hello</Label>)
expect(container.firstChild).toBeInTheDocument()
})
it('renders required state', () => {
const { container } = render(
<Label required htmlFor="hello">
Hello
</Label>
)
expect(container.firstChild).toHaveAttribute('title', 'Required')
expect(container.firstChild).toHaveClass('required')
})
})