import { render } from '@react-email/render'; import { Link } from './index.js'; describe(' component', () => { it('renders children correctly', async () => { const testMessage = 'Test message'; const html = await render( {testMessage}, ); expect(html).toContain(testMessage); }); it('passes style and other props correctly', async () => { const style = { color: 'red' }; const html = await render( Test , ); expect(html).toContain('color:red'); expect(html).toContain('data-testid="link-test"'); }); it('opens in a new tab', async () => { const html = await render(Test); expect(html).toContain(`target="_blank"`); }); it('renders correctly', async () => { const actualOutput = await render( Example, ); expect(actualOutput).toMatchInlineSnapshot( `"Example"`, ); }); });