mirror of
https://github.com/oceanprotocol/commons.git
synced 2023-03-15 18:03:00 +01:00
21 lines
633 B
TypeScript
21 lines
633 B
TypeScript
|
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')
|
||
|
})
|
||
|
})
|