File tree 1 file changed +63
-0
lines changed
1 file changed +63
-0
lines changed Original file line number Diff line number Diff line change @@ -1189,6 +1189,69 @@ The first step
1189
1189
expect ( result . levels ) . toEqual ( expected . levels ) ;
1190
1190
} ) ;
1191
1191
1192
+ it ( "should parse a single hint" , ( ) => {
1193
+ const md = `# Title
1194
+
1195
+ Description.
1196
+
1197
+ ## 1. Title 1
1198
+
1199
+ First level content.
1200
+
1201
+ ### 1.1
1202
+
1203
+ The first step
1204
+
1205
+ #### HINTS
1206
+
1207
+ - A test with a \`backtick\`
1208
+
1209
+ ` ;
1210
+ const skeleton = {
1211
+ levels : [
1212
+ {
1213
+ id : "1" ,
1214
+ steps : [
1215
+ {
1216
+ id : "1.1" ,
1217
+ } ,
1218
+ ] ,
1219
+ } ,
1220
+ ] ,
1221
+ } ;
1222
+ const result = parse ( {
1223
+ text : md ,
1224
+ skeleton,
1225
+ commits : {
1226
+ "1.1:T" : [ "abcdef1" , "123456789" ] ,
1227
+ } ,
1228
+ } ) ;
1229
+ const expected = {
1230
+ summary : {
1231
+ description : "Description." ,
1232
+ } ,
1233
+ levels : [
1234
+ {
1235
+ id : "1" ,
1236
+ title : "Title 1" ,
1237
+ summary : "First level content." ,
1238
+ content : "First level content." ,
1239
+ steps : [
1240
+ {
1241
+ id : "1.1" ,
1242
+ content : "The first step" ,
1243
+ setup : {
1244
+ commits : [ "abcdef1" , "123456789" ] ,
1245
+ } ,
1246
+ hints : [ "A test with a `backtick`" ] ,
1247
+ } ,
1248
+ ] ,
1249
+ } ,
1250
+ ] ,
1251
+ } ;
1252
+ expect ( result . levels ) . toEqual ( expected . levels ) ;
1253
+ } ) ;
1254
+
1192
1255
it ( "should parse hints for a step with '-'" , ( ) => {
1193
1256
const md = `# Title
1194
1257
You can’t perform that action at this time.
0 commit comments