UNPKG

dg-npm-templates

Version:

Npx generator for react app dependency creation by digite

13 lines (10 loc) 474 B
import React from 'react'; import { render, screen } from '@testing-library/react'; import ErrorBoxView from 'js/common/components/ErrorBoxView'; test('renders error box', () => { const {container, getByText } = render( <ErrorBoxView dataHtml={ "This is error box" } />); screen.debug(); expect(container).toMatchSnapshot(); expect(getByText(/This is error box/i)).toBeInTheDocument(); expect(container.getElementsByClassName('message_cnt').length).toBe(1); });