File tree Expand file tree Collapse file tree 1 file changed +84
-0
lines changed Expand file tree Collapse file tree 1 file changed +84
-0
lines changed Original file line number Diff line number Diff line change @@ -1475,6 +1475,90 @@ The second uninterrupted step
1475
1475
} ;
1476
1476
expect ( result . levels [ 0 ] ) . toEqual ( expected . levels [ 0 ] ) ;
1477
1477
} ) ;
1478
+ it ( 'should work with a single test on the final lesson' , ( ) => {
1479
+ // issue: https://github.com/coderoad/coderoad-vscode/issues/480
1480
+ const md = `# Title
1481
+
1482
+ Description.
1483
+
1484
+ ## 1. Title 1
1485
+
1486
+ First level content.
1487
+
1488
+ ### 1.1
1489
+
1490
+ The first step
1491
+
1492
+ ### 1.2
1493
+
1494
+ The second uninterrupted step
1495
+
1496
+ #### HINTS
1497
+
1498
+ * First Hint with \`markdown\`. See **bold**` ;
1499
+ const skeleton = {
1500
+ levels : [
1501
+ {
1502
+ id : "1" ,
1503
+ steps : [
1504
+ {
1505
+ id : "1.1" ,
1506
+ } ,
1507
+ {
1508
+ id : "1.2" ,
1509
+ } ,
1510
+ ] ,
1511
+ } ,
1512
+ ] ,
1513
+ } ;
1514
+ const result = parse ( {
1515
+ text : md ,
1516
+ skeleton,
1517
+ commits : {
1518
+ "1.1:T" : [ "abcdef1" ] ,
1519
+ "1.1:S" : [ "123456789" ] ,
1520
+ "1.2:T" : [ "fedcba1" ] ,
1521
+ } ,
1522
+ } ) ;
1523
+ const expected = {
1524
+ summary : {
1525
+ description : "Description." ,
1526
+ } ,
1527
+ levels : [
1528
+ {
1529
+ id : "1" ,
1530
+ title : "Title 1" ,
1531
+ summary : "First level content." ,
1532
+ content : "First level content." ,
1533
+ steps : [
1534
+ {
1535
+ id : "1.1" ,
1536
+ content : "The first step" ,
1537
+ setup : {
1538
+ commits : [ "abcdef1" ] ,
1539
+ } ,
1540
+ solution : {
1541
+ commits : [ "123456789" ] ,
1542
+ } ,
1543
+
1544
+ } ,
1545
+ {
1546
+ id : "1.2" ,
1547
+ content : "The second uninterrupted step" ,
1548
+ setup : {
1549
+ commits : [ "fedcba1" ] ,
1550
+ } ,
1551
+ hints : [
1552
+ "First Hint with `markdown`. See **bold**"
1553
+ ] ,
1554
+ } ,
1555
+ ] ,
1556
+ } ,
1557
+ { } ,
1558
+ ] ,
1559
+ } ;
1560
+ expect ( result . levels [ 0 ] ) . toEqual ( expected . levels [ 0 ] ) ;
1561
+ } )
1478
1562
} ) ;
1479
1563
describe ( "subtasks" , ( ) => {
1480
1564
it ( "should parse subtasks" , ( ) => {
You can’t perform that action at this time.
0 commit comments