@navinc/base-react-components
Version:
Nav's Pattern Library
20 lines (15 loc) • 565 B
JavaScript
import React from 'react'
import { render, screen } from '../../../tests/with-app-context.js'
import { PercentInputField } from './index.js'
describe('Base Components: PercentInput', () => {
describe('render', () => {
it('renders the label', () => {
render(<PercentInputField label="test label" />)
expect(screen.getByText('test label')).toBeInTheDocument()
})
it('renders errors if there are any', () => {
render(<PercentInputField errors={['yoyo']} />)
expect(screen.getByText('yoyo')).toBeInTheDocument()
})
})
})