@@ -13,7 +13,7 @@ import {
13
13
TEST_ORGANIZATION ,
14
14
USER_EDITOR
15
15
} from '../../utils/testQuery' ;
16
- import { queryAsUserIsExpectedForbidden } from '../../utils/testQueryHelper' ;
16
+ import { queryAsAdminWithSuccess , queryAsUserIsExpectedForbidden } from '../../utils/testQueryHelper' ;
17
17
import { ENTITY_TYPE_CONTAINER_CASE_INCIDENT } from '../../../src/modules/case/case-incident/case-incident-types' ;
18
18
19
19
const CREATE_QUERY = gql `
@@ -450,7 +450,7 @@ describe('Case Incident Response and organization sharing standard behavior with
450
450
settingsInternalId = queryResult . data ?. settings ?. id ;
451
451
452
452
// Set EE
453
- const EEqueryResult = await adminQuery ( {
453
+ const EEqueryResult = await queryAsAdminWithSuccess ( {
454
454
query : PLATFORM_ORGANIZATION_QUERY ,
455
455
variables : {
456
456
id : settingsInternalId ,
@@ -459,7 +459,6 @@ describe('Case Incident Response and organization sharing standard behavior with
459
459
]
460
460
}
461
461
} ) ;
462
- expect ( EEqueryResult ) . not . toBeNull ( ) ;
463
462
expect ( EEqueryResult ?. data ?. settingsEdit . fieldPatch . enterprise_edition ) . not . toBeUndefined ( ) ;
464
463
} ) ;
465
464
it ( 'should share Case Incident Response with Organization' , async ( ) => {
@@ -497,15 +496,13 @@ describe('Case Incident Response and organization sharing standard behavior with
497
496
expect ( queryResult ?. data ?. caseIncident ) . toBeNull ( ) ;
498
497
} ) ;
499
498
it ( 'should EE deactivated' , async ( ) => {
500
- const platformOrganization = await adminQuery ( {
499
+ const EEDeactivationQuery = await queryAsAdminWithSuccess ( {
501
500
query : PLATFORM_ORGANIZATION_QUERY ,
502
- variables : { id : settingsInternalId ,
503
- input : [
504
- { key : 'enterprise_edition' , value : [ ] } ,
505
- ] }
501
+ variables : {
502
+ id : settingsInternalId ,
503
+ input : [ { key : 'enterprise_edition' , value : [ ] } ] } ,
506
504
} ) ;
507
- expect ( platformOrganization ) . not . toBeNull ( ) ;
508
- expect ( platformOrganization ?. data ?. settingsEdit . fieldPatch . enterprise_edition ) . toBeNull ( ) ;
505
+ expect ( EEDeactivationQuery ?. data ?. settingsEdit . fieldPatch . enterprise_edition ) . toBeNull ( ) ;
509
506
} ) ;
510
507
} ) ;
511
508
@@ -535,7 +532,7 @@ describe('Case Incident Response and organization sharing standard behavior with
535
532
settingsInternalId = queryResult . data ?. settings ?. id ;
536
533
537
534
// Set plateform organization
538
- const platformOrganization = await adminQuery ( {
535
+ const platformOrganization = await queryAsAdminWithSuccess ( {
539
536
query : PLATFORM_ORGANIZATION_QUERY ,
540
537
variables : {
541
538
id : settingsInternalId ,
@@ -545,8 +542,6 @@ describe('Case Incident Response and organization sharing standard behavior with
545
542
]
546
543
}
547
544
} ) ;
548
-
549
- expect ( platformOrganization ) . not . toBeNull ( ) ;
550
545
expect ( platformOrganization ?. data ?. settingsEdit . fieldPatch . platform_organization ) . not . toBeUndefined ( ) ;
551
546
expect ( platformOrganization ?. data ?. settingsEdit . fieldPatch . enterprise_edition ) . not . toBeUndefined ( ) ;
552
547
expect ( platformOrganization ?. data ?. settingsEdit . fieldPatch . platform_organization . name ) . toEqual ( PLATFORM_ORGANIZATION . name ) ;
@@ -571,7 +566,7 @@ describe('Case Incident Response and organization sharing standard behavior with
571
566
expect ( caseIRQueryResult ) . not . toBeNull ( ) ;
572
567
expect ( caseIRQueryResult . data ?. caseIncident ) . toBeNull ( ) ;
573
568
} ) ;
574
- it ( 'should Admin user Authorized Members activated ' , async ( ) => {
569
+ it ( 'should Admin user activate Authorized Members' , async ( ) => {
575
570
userEditorId = await getUserIdByEmail ( USER_EDITOR . email ) ;
576
571
const caseIRUpdatedQueryResult = await queryAsAdmin ( {
577
572
query : EDIT_AUTHORIZED_MEMBERS_QUERY ,
@@ -641,15 +636,16 @@ describe('Case Incident Response and organization sharing standard behavior with
641
636
} ) ;
642
637
it ( 'should plateform organization sharing and EE deactivated' , async ( ) => {
643
638
// Remove plateform organization
644
- const platformOrganization = await adminQuery ( {
639
+ const platformOrganization = await queryAsAdminWithSuccess ( {
645
640
query : PLATFORM_ORGANIZATION_QUERY ,
646
- variables : { id : settingsInternalId ,
641
+ variables : {
642
+ id : settingsInternalId ,
647
643
input : [
648
644
{ key : 'platform_organization' , value : [ ] } ,
649
- { key : 'enterprise_edition' , value : [ ] } , // check null a la place de [ }
650
- ] }
645
+ { key : 'enterprise_edition' , value : [ ] } ,
646
+ ]
647
+ }
651
648
} ) ;
652
- expect ( platformOrganization ) . not . toBeNull ( ) ;
653
649
expect ( platformOrganization ?. data ?. settingsEdit . fieldPatch . platform_organization ) . toBeNull ( ) ;
654
650
} ) ;
655
651
it ( 'should Case Incident Response deleted' , async ( ) => {
0 commit comments