Skip to content

Commit 6cf5f36

Browse files
jhildenbiddlesy-records
authored andcommittedAug 11, 2024··
Add tests for new callout syntax
1 parent db423b6 commit 6cf5f36

File tree

1 file changed

+43
-3
lines changed

1 file changed

+43
-3
lines changed
 

‎test/integration/render.test.js

+43-3
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,60 @@ import { waitForText } from '../helpers/wait-for.js';
77
describe('render', function () {
88
// Helpers
99
// ---------------------------------------------------------------------------
10-
describe('helpers', () => {
10+
describe('callouts', () => {
1111
beforeEach(async () => {
1212
await docsifyInit();
1313
});
1414

15-
test('important content', () => {
15+
test('caution', () => {
16+
const output = window.marked('> [!CAUTION]\n> Text');
17+
18+
expect(output).toMatchInlineSnapshot(
19+
`"<div class="callout caution"><p>Text</p></div>"`,
20+
);
21+
});
22+
23+
test('important', () => {
24+
const output = window.marked('> [!IMPORTANT]\n> Text');
25+
26+
expect(output).toMatchInlineSnapshot(
27+
`"<div class="callout important"><p>Text</p></div>"`,
28+
);
29+
});
30+
31+
test('note', () => {
32+
const output = window.marked('> [!NOTE]\n> Text');
33+
34+
expect(output).toMatchInlineSnapshot(
35+
`"<div class="callout note"><p>Text</p></div>"`,
36+
);
37+
});
38+
39+
test('tip', () => {
40+
const output = window.marked('> [!TIP]\n> Text');
41+
42+
expect(output).toMatchInlineSnapshot(
43+
`"<div class="callout tip"><p>Text</p></div>"`,
44+
);
45+
});
46+
47+
test('warning', () => {
48+
const output = window.marked('> [!WARNING]\n> Text');
49+
50+
expect(output).toMatchInlineSnapshot(
51+
`"<div class="callout warning"><p>Text</p></div>"`,
52+
);
53+
});
54+
55+
test('important (legacy)', () => {
1656
const output = window.marked('!> Important content');
1757

1858
expect(output).toMatchInlineSnapshot(
1959
`"<p class="callout important">Important content</p>"`,
2060
);
2161
});
2262

23-
test('general tip', () => {
63+
test('tip (legacy)', () => {
2464
const output = window.marked('?> General tip');
2565

2666
expect(output).toMatchInlineSnapshot(

0 commit comments

Comments
 (0)
Please sign in to comment.