import React from 'react'; import { render } from 'react-testing-library'; import AtPrefix from '../AtPrefix'; describe('', () => { it('should render an tag', () => { const { container: { firstChild }, } = render(); expect(firstChild.tagName).toEqual('SPAN'); }); it('should have a class attribute', () => { const { container: { firstChild }, } = render(); expect(firstChild.hasAttribute('class')).toBe(true); }); it('should adopt a valid attribute', () => { const id = 'test'; const { container: { firstChild }, } = render(); expect(firstChild.id).toEqual(id); }); it('should not adopt an invalid attribute', () => { const { container: { firstChild }, } = render(); expect(firstChild.hasAttribute('attribute')).toBe(false); }); });