@@ -1379,4 +1379,96 @@ describe('Progress Tab', () => {
1379
1379
expect ( screen . getByText ( 'Course progress for otherstudent' ) ) . toBeInTheDocument ( ) ;
1380
1380
} ) ;
1381
1381
} ) ;
1382
+
1383
+ describe ( 'Completion Donut Chart' , ( ) => {
1384
+ it ( 'Renders optional completion donut chart' , async ( ) => {
1385
+ setTabData ( {
1386
+ completion_summary : {
1387
+ complete_count : 1 ,
1388
+ incomplete_count : 1 ,
1389
+ locked_count : 1 ,
1390
+ } ,
1391
+ optional_completion_summary : {
1392
+ complete_count : 1 ,
1393
+ incomplete_count : 1 ,
1394
+ locked_count : 0 ,
1395
+ } ,
1396
+ verified_mode : {
1397
+ access_expiration_date : '2050-01-01T12:00:00' ,
1398
+ currency : 'USD' ,
1399
+ currency_symbol : '$' ,
1400
+ price : 149 ,
1401
+ sku : 'ABCD1234' ,
1402
+ upgrade_url : 'edx.org/upgrade' ,
1403
+ } ,
1404
+ section_scores : [
1405
+ {
1406
+ display_name : 'First section' ,
1407
+ subsections : [
1408
+ {
1409
+ assignment_type : 'Homework' ,
1410
+ block_key : 'block-v1:edX+DemoX+Demo_Course+type@sequential+block@12345' ,
1411
+ display_name : 'First subsection' ,
1412
+ learner_has_access : false ,
1413
+ has_graded_assignment : true ,
1414
+ num_points_earned : 8 ,
1415
+ num_points_possible : 10 ,
1416
+ percent_graded : 1.0 ,
1417
+ show_correctness : 'always' ,
1418
+ show_grades : true ,
1419
+ url : 'http://learning.edx.org/course/course-v1:edX+Test+run/first_subsection' ,
1420
+ } ,
1421
+ ] ,
1422
+ } ,
1423
+ ] ,
1424
+ } ) ;
1425
+ await fetchAndRender ( ) ;
1426
+ expect ( screen . getByText ( 'optional' ) ) . toBeInTheDocument ( ) ;
1427
+ } ) ;
1428
+
1429
+ it ( 'Hides optional completion donut chart' , async ( ) => {
1430
+ setTabData ( {
1431
+ completion_summary : {
1432
+ complete_count : 1 ,
1433
+ incomplete_count : 1 ,
1434
+ locked_count : 1 ,
1435
+ } ,
1436
+ optional_completion_summary : {
1437
+ complete_count : 0 ,
1438
+ incomplete_count : 0 ,
1439
+ locked_count : 0 ,
1440
+ } ,
1441
+ verified_mode : {
1442
+ access_expiration_date : '2050-01-01T12:00:00' ,
1443
+ currency : 'USD' ,
1444
+ currency_symbol : '$' ,
1445
+ price : 149 ,
1446
+ sku : 'ABCD1234' ,
1447
+ upgrade_url : 'edx.org/upgrade' ,
1448
+ } ,
1449
+ section_scores : [
1450
+ {
1451
+ display_name : 'First section' ,
1452
+ subsections : [
1453
+ {
1454
+ assignment_type : 'Homework' ,
1455
+ block_key : 'block-v1:edX+DemoX+Demo_Course+type@sequential+block@12345' ,
1456
+ display_name : 'First subsection' ,
1457
+ learner_has_access : false ,
1458
+ has_graded_assignment : true ,
1459
+ num_points_earned : 8 ,
1460
+ num_points_possible : 10 ,
1461
+ percent_graded : 1.0 ,
1462
+ show_correctness : 'always' ,
1463
+ show_grades : true ,
1464
+ url : 'http://learning.edx.org/course/course-v1:edX+Test+run/first_subsection' ,
1465
+ } ,
1466
+ ] ,
1467
+ } ,
1468
+ ] ,
1469
+ } ) ;
1470
+ await fetchAndRender ( ) ;
1471
+ expect ( screen . queryByText ( 'optional' ) ) . not . toBeInTheDocument ( ) ;
1472
+ } ) ;
1473
+ } ) ;
1382
1474
} ) ;
0 commit comments