@@ -241,7 +241,8 @@ describe('SubmissionSectionCcLicensesComponent', () => {
241241 } ) ;
242242
243243 it ( 'should have section status incomplete' , ( ) => {
244- expect ( component . getSectionStatus ( ) ) . toBeObservable ( cold ( '(a|)' , { a : false } ) ) ;
244+ component . required$ . next ( true ) ;
245+ expect ( component . getSectionStatus ( ) ) . toBeObservable ( cold ( '(a)' , { a : false } ) ) ;
245246 } ) ;
246247
247248 describe ( 'when all options have a value selected' , ( ) => {
@@ -271,7 +272,13 @@ describe('SubmissionSectionCcLicensesComponent', () => {
271272 } ) ;
272273
273274 it ( 'should have section status incomplete' , ( ) => {
274- expect ( component . getSectionStatus ( ) ) . toBeObservable ( cold ( '(a|)' , { a : false } ) ) ;
275+ component . required$ . next ( true ) ;
276+ expect ( component . getSectionStatus ( ) ) . toBeObservable ( cold ( '(a)' , { a : false } ) ) ;
277+ } ) ;
278+
279+ it ( 'should have section status complete if not required' , ( ) => {
280+ component . required$ . next ( false ) ;
281+ expect ( component . getSectionStatus ( ) ) . toBeObservable ( cold ( '(a)' , { a : true } ) ) ;
275282 } ) ;
276283
277284 describe ( 'when the cc license is accepted' , ( ) => {
@@ -282,7 +289,8 @@ describe('SubmissionSectionCcLicensesComponent', () => {
282289 } ) ;
283290
284291 it ( 'should have section status complete' , ( ) => {
285- expect ( component . getSectionStatus ( ) ) . toBeObservable ( cold ( '(a|)' , { a : true } ) ) ;
292+ component . required$ . next ( false ) ;
293+ expect ( component . getSectionStatus ( ) ) . toBeObservable ( cold ( '(a)' , { a : true } ) ) ; // first true is because the section is not required
286294 } ) ;
287295 } ) ;
288296 } ) ;
0 commit comments