@@ -7,20 +7,60 @@ import { waitForText } from '../helpers/wait-for.js';
7
7
describe ( 'render' , function ( ) {
8
8
// Helpers
9
9
// ---------------------------------------------------------------------------
10
- describe ( 'helpers ' , ( ) => {
10
+ describe ( 'callouts ' , ( ) => {
11
11
beforeEach ( async ( ) => {
12
12
await docsifyInit ( ) ;
13
13
} ) ;
14
14
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)' , ( ) => {
16
56
const output = window . marked ( '!> Important content' ) ;
17
57
18
58
expect ( output ) . toMatchInlineSnapshot (
19
59
`"<p class="callout important">Important content</p>"` ,
20
60
) ;
21
61
} ) ;
22
62
23
- test ( 'general tip' , ( ) => {
63
+ test ( 'tip (legacy) ' , ( ) => {
24
64
const output = window . marked ( '?> General tip' ) ;
25
65
26
66
expect ( output ) . toMatchInlineSnapshot (
0 commit comments