@navinc/base-react-components
Version:
Nav's Pattern Library
16 lines (13 loc) • 450 B
JavaScript
import '@testing-library/jest-dom/extend-expect'
import React from 'react'
import { renderWithContext, screen } from '../tests/with-app-context.js'
import Icon from './icon.js'
describe('Icon', () => {
it('renders a svg if a proper name is supplied', (done) => {
renderWithContext(<Icon name="actions/close" />)
screen.findByTestId('icon:actions/close').then((icon) => {
expect(icon).toBeInTheDocument()
done()
})
})
})