Skip to content

Commit 6389ddb

Browse files
committed
chore: update tests
1 parent fd4b2be commit 6389ddb

File tree

8 files changed

+35
-14
lines changed

8 files changed

+35
-14
lines changed

packages/jsx-email/src/components/button/button.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import React from 'react';
22

3+
import type { BaseProps, JsxEmailComponent } from '../../types';
4+
35
import { parsePadding } from './padding';
46

57
type RootProps = BaseProps<'a'>;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
22

3+
exports[`<Hr> component > disables the default styles 1`] = `"<hr data-id=\\"jsx-email/hr\\" style=\\"\\"/>"`;
4+
35
exports[`<Hr> component > renders correctly 1`] = `"<hr data-id=\\"jsx-email/hr\\" style=\\"border:none;border-top:1px solid #eaeaea;width:100%\\"/>"`;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
22

3-
exports[`<Link> component > renders correctly 1`] = `"<a href=\\"https://example.com\\" data-id=\\"jsx-email/link\\" target=\\"_blank\\" style=\\"color:#067df7;text-decoration:none\\">Example</a>"`;
3+
exports[`<Link> component > renders correctly 1`] = `"<a href=\\"https://example.com\\" data-id=\\"jsx-email/link\\" style=\\"color:#067df7;text-decoration:none\\">Example</a>"`;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
22

3+
exports[`<Text> component > disables the default styles 1`] = `"<p data-id=\\"jsx-email/text\\" style=\\"\\">Test message</p>"`;
4+
35
exports[`<Text> component > renders correctly 1`] = `"<p data-id=\\"jsx-email/text\\" style=\\"font-size:14px;line-height:24px;margin:16px 0\\">Lorem ipsum</p>"`;

packages/jsx-email/test/hr.test.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,9 @@ describe('<Hr> component', () => {
2222
const actualOutput = await jsxToString(<Hr />);
2323
expect(actualOutput).toMatchSnapshot();
2424
});
25+
26+
it('disables the default styles', async () => {
27+
const actualOutput = await jsxToString(<Hr disableDefaultStyle={true} />);
28+
expect(actualOutput).toMatchSnapshot();
29+
});
2530
});

packages/jsx-email/test/link.test.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@ describe('<Link> component', async () => {
2828
});
2929

3030
it('opens in a new tab', async () => {
31-
const html = await jsxToString(<Link href="https://example.com">Test</Link>);
31+
const html = await jsxToString(
32+
<Link href="https://example.com" target="_blank">
33+
Test
34+
</Link>
35+
);
3236
expect(html).toContain(`target="_blank"`);
3337
});
3438

packages/jsx-email/test/render/.snapshots/render.test.tsx.snap

Lines changed: 12 additions & 12 deletions
Large diffs are not rendered by default.

packages/jsx-email/test/text.test.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,10 @@ describe('<Text> component', async () => {
3131
const actualOutput = await jsxToString(<Text>Lorem ipsum</Text>);
3232
expect(actualOutput).toMatchSnapshot();
3333
});
34+
35+
it('disables the default styles', async () => {
36+
const testMessage = 'Test message';
37+
const html = await jsxToString(<Text disableDefaultStyle={true}>{testMessage}</Text>);
38+
expect(html).toMatchSnapshot();
39+
});
3440
});

0 commit comments

Comments
 (0)