@@ -258,6 +258,84 @@ describe('Unit | Domain | Models | OrganizationForAdmin', function () {
258
258
) . to . equal ( true ) ;
259
259
} ) ;
260
260
261
+ context ( 'when updating AEFE tags' , function ( ) {
262
+ it ( 'should enable compute organization learner certificability for SCO organization' , function ( ) {
263
+ // given
264
+ const givenOrganization = new OrganizationForAdmin ( {
265
+ isManagingStudents : false ,
266
+ type : 'SCO' ,
267
+ features : {
268
+ [ ORGANIZATION_FEATURE . COMPUTE_ORGANIZATION_LEARNER_CERTIFICABILITY . key ] : false ,
269
+ } ,
270
+ } ) ;
271
+
272
+ // when
273
+ givenOrganization . updateWithDataProtectionOfficerAndTags ( { } , { } , [ { name : 'AEFE' , id : 1 } ] ) ;
274
+
275
+ // then
276
+ expect (
277
+ givenOrganization . features [ ORGANIZATION_FEATURE . COMPUTE_ORGANIZATION_LEARNER_CERTIFICABILITY . key ] ,
278
+ ) . to . equal ( true ) ;
279
+ } ) ;
280
+
281
+ it ( 'should disable compute organization learner certificability on removing AEFE' , function ( ) {
282
+ // given
283
+ const givenOrganization = new OrganizationForAdmin ( {
284
+ isManagingStudents : false ,
285
+ type : 'SCO' ,
286
+ features : {
287
+ [ ORGANIZATION_FEATURE . COMPUTE_ORGANIZATION_LEARNER_CERTIFICABILITY . key ] : true ,
288
+ } ,
289
+ } ) ;
290
+
291
+ // when
292
+ givenOrganization . updateWithDataProtectionOfficerAndTags ( { } ) ;
293
+
294
+ // then
295
+ expect (
296
+ givenOrganization . features [ ORGANIZATION_FEATURE . COMPUTE_ORGANIZATION_LEARNER_CERTIFICABILITY . key ] ,
297
+ ) . to . equal ( false ) ;
298
+ } ) ;
299
+
300
+ it ( 'should not enable compute organization learner certificability for SUP organization' , function ( ) {
301
+ // given
302
+ const givenOrganization = new OrganizationForAdmin ( {
303
+ isManagingStudents : false ,
304
+ type : 'SUP' ,
305
+ features : {
306
+ [ ORGANIZATION_FEATURE . COMPUTE_ORGANIZATION_LEARNER_CERTIFICABILITY . key ] : false ,
307
+ } ,
308
+ } ) ;
309
+
310
+ // when
311
+ givenOrganization . updateWithDataProtectionOfficerAndTags ( { } , { } , [ { name : 'AEFE' , id : 1 } ] ) ;
312
+
313
+ // then
314
+ expect (
315
+ givenOrganization . features [ ORGANIZATION_FEATURE . COMPUTE_ORGANIZATION_LEARNER_CERTIFICABILITY . key ] ,
316
+ ) . to . equal ( false ) ;
317
+ } ) ;
318
+
319
+ it ( 'should not enable compute organization learner certificability for PRO organization' , function ( ) {
320
+ // given
321
+ const givenOrganization = new OrganizationForAdmin ( {
322
+ isManagingStudents : false ,
323
+ type : 'PRO' ,
324
+ features : {
325
+ [ ORGANIZATION_FEATURE . COMPUTE_ORGANIZATION_LEARNER_CERTIFICABILITY . key ] : false ,
326
+ } ,
327
+ } ) ;
328
+
329
+ // when
330
+ givenOrganization . updateWithDataProtectionOfficerAndTags ( { } , { } , [ { name : 'AEFE' , id : 1 } ] ) ;
331
+
332
+ // then
333
+ expect (
334
+ givenOrganization . features [ ORGANIZATION_FEATURE . COMPUTE_ORGANIZATION_LEARNER_CERTIFICABILITY . key ] ,
335
+ ) . to . equal ( false ) ;
336
+ } ) ;
337
+ } ) ;
338
+
261
339
it ( 'should disable compute organization learner certificability when updating SCO organization isManagingStudents to false' , function ( ) {
262
340
// given
263
341
const givenOrganization = new OrganizationForAdmin ( {
0 commit comments