@@ -85,6 +85,26 @@ describe('KM Editor Warnings', () => {
85
85
cy . checkFields ( question )
86
86
} )
87
87
88
+ it ( 'Question Item Select' , ( ) => {
89
+ const chapter = {
90
+ title : 'Chapter 1' ,
91
+ text : 'This chapter text'
92
+ }
93
+ const question = {
94
+ s_type : 'ItemSelect' ,
95
+ title : 'Question 1' ,
96
+ text : 'This question text'
97
+ }
98
+ editor . createChildren ( [ [ 'chapter' , chapter ] , [ 'question' , question ] ] )
99
+
100
+ cy . visitApp ( '/km-editor' )
101
+ editor . open ( kmId )
102
+ editor . expectWarningsCount ( 1 )
103
+ editor . openWarnings ( )
104
+ cy . contains ( 'No list question selected for item select question' ) . click ( )
105
+ cy . checkFields ( question )
106
+ } )
107
+
88
108
it ( 'Question Choices' , ( ) => {
89
109
const chapter = {
90
110
title : 'Chapter 1' ,
@@ -353,4 +373,46 @@ describe('KM Editor Warnings', () => {
353
373
cy . checkFields ( integration )
354
374
} )
355
375
} )
356
- } )
376
+
377
+ it ( 'Resource Collection' , ( ) => {
378
+ editor . createChildren ( [
379
+ [ 'resource-collection' , { } ]
380
+ ] )
381
+
382
+ const warnings = [
383
+ 'Empty title for resource collection'
384
+ ]
385
+
386
+ warnings . forEach ( warning => {
387
+ cy . visitApp ( '/km-editor' )
388
+ editor . open ( kmId )
389
+ editor . expectWarningsCount ( warnings . length )
390
+ editor . openWarnings ( )
391
+ cy . contains ( warning ) . click ( )
392
+ } )
393
+ } )
394
+
395
+ it ( 'Resource Page' , ( ) => {
396
+ const resourceCollection = {
397
+ title : 'Resource Collection'
398
+ }
399
+
400
+ editor . createChildren ( [
401
+ [ 'resource-collection' , resourceCollection ] ,
402
+ [ 'resource-page' , { } ]
403
+ ] )
404
+
405
+ const warnings = [
406
+ 'Empty title for resource page' ,
407
+ 'Empty content for resource page' ,
408
+ ]
409
+
410
+ warnings . forEach ( warning => {
411
+ cy . visitApp ( '/km-editor' )
412
+ editor . open ( kmId )
413
+ editor . expectWarningsCount ( warnings . length )
414
+ editor . openWarnings ( )
415
+ cy . contains ( warning ) . click ( )
416
+ } )
417
+ } )
418
+ } )
0 commit comments