@@ -8,12 +8,11 @@ import {
8
8
getOrganizationIdByName ,
9
9
getUserIdByEmail ,
10
10
PLATFORM_ORGANIZATION ,
11
- queryAsAdmin ,
12
11
securityQuery ,
13
12
TEST_ORGANIZATION ,
14
13
USER_EDITOR
15
14
} from '../../utils/testQuery' ;
16
- import { queryAsAdminWithSuccess , queryAsUserIsExpectedForbidden } from '../../utils/testQueryHelper' ;
15
+ import { adminQueryWithSuccess , queryAsUserIsExpectedForbidden } from '../../utils/testQueryHelper' ;
17
16
import { ENTITY_TYPE_CONTAINER_CASE_INCIDENT } from '../../../src/modules/case/case-incident/case-incident-types' ;
18
17
19
18
const CREATE_QUERY = gql `
@@ -122,7 +121,7 @@ describe('Case Incident Response standard behavior with authorized_members activ
122
121
let userEditorId : string ;
123
122
it ( 'should Case Incident Response created' , async ( ) => {
124
123
// Create Case Incident Response
125
- const caseIncidentResponseCreateQueryResult = await queryAsAdmin ( {
124
+ const caseIncidentResponseCreateQueryResult = await adminQuery ( {
126
125
query : CREATE_QUERY ,
127
126
variables : {
128
127
input : {
@@ -162,7 +161,7 @@ describe('Case Incident Response standard behavior with authorized_members activ
162
161
} ) ;
163
162
it ( 'should Admin user edit authorized members' , async ( ) => {
164
163
// Activate Authorized members
165
- const caseIncidentResponseUpdatedQueryResult = await queryAsAdmin ( {
164
+ const caseIncidentResponseUpdatedQueryResult = await adminQuery ( {
166
165
query : EDIT_AUTHORIZED_MEMBERS_QUERY ,
167
166
variables : {
168
167
id : caseIncident ?. id ,
@@ -191,7 +190,7 @@ describe('Case Incident Response standard behavior with authorized_members activ
191
190
} ) ;
192
191
it ( 'should Admin user edit authorized members: Editor has view access right' , async ( ) => {
193
192
// Add Editor user in authorized members
194
- const caseIncidentResponseUpdatedQueryResult = await queryAsAdmin ( {
193
+ const caseIncidentResponseUpdatedQueryResult = await adminQuery ( {
195
194
query : EDIT_AUTHORIZED_MEMBERS_QUERY ,
196
195
variables : {
197
196
id : caseIncident . id ,
@@ -236,7 +235,7 @@ describe('Case Incident Response standard behavior with authorized_members activ
236
235
} ) ;
237
236
} ) ;
238
237
it ( 'should Admin user edit authorized members: Editor has edit access right' , async ( ) => {
239
- const caseIncidentResponseUpdatedQueryResult = await queryAsAdmin ( {
238
+ const caseIncidentResponseUpdatedQueryResult = await adminQuery ( {
240
239
query : EDIT_AUTHORIZED_MEMBERS_QUERY ,
241
240
variables : {
242
241
id : caseIncident . id ,
@@ -277,7 +276,7 @@ describe('Case Incident Response standard behavior with authorized_members activ
277
276
} ) ;
278
277
} ) ;
279
278
it ( 'should Admin user edit authorized members: Editor has admin access right' , async ( ) => {
280
- const caseIncidentResponseUpdatedQueryResult = await queryAsAdmin ( {
279
+ const caseIncidentResponseUpdatedQueryResult = await adminQuery ( {
281
280
query : EDIT_AUTHORIZED_MEMBERS_QUERY ,
282
281
variables : {
283
282
id : caseIncident . id ,
@@ -314,7 +313,7 @@ describe('Case Incident Response standard behavior with authorized_members activ
314
313
variables : { id : caseIncident . id } ,
315
314
} ) ;
316
315
// Verify is no longer found
317
- const queryResult = await queryAsAdmin ( { query : READ_QUERY , variables : { id : caseIncident . id } } ) ;
316
+ const queryResult = await adminQuery ( { query : READ_QUERY , variables : { id : caseIncident . id } } ) ;
318
317
expect ( queryResult ) . not . toBeNull ( ) ;
319
318
expect ( queryResult ?. data ?. caseIncident ) . toBeNull ( ) ;
320
319
} ) ;
@@ -450,7 +449,7 @@ describe('Case Incident Response and organization sharing standard behavior with
450
449
settingsInternalId = queryResult . data ?. settings ?. id ;
451
450
452
451
// Set EE
453
- const EEqueryResult = await queryAsAdminWithSuccess ( {
452
+ const EEqueryResult = await adminQueryWithSuccess ( {
454
453
query : PLATFORM_ORGANIZATION_QUERY ,
455
454
variables : {
456
455
id : settingsInternalId ,
@@ -496,7 +495,7 @@ describe('Case Incident Response and organization sharing standard behavior with
496
495
expect ( queryResult ?. data ?. caseIncident ) . toBeNull ( ) ;
497
496
} ) ;
498
497
it ( 'should EE deactivated' , async ( ) => {
499
- const EEDeactivationQuery = await queryAsAdminWithSuccess ( {
498
+ const EEDeactivationQuery = await adminQueryWithSuccess ( {
500
499
query : PLATFORM_ORGANIZATION_QUERY ,
501
500
variables : {
502
501
id : settingsInternalId ,
@@ -532,7 +531,7 @@ describe('Case Incident Response and organization sharing standard behavior with
532
531
settingsInternalId = queryResult . data ?. settings ?. id ;
533
532
534
533
// Set plateform organization
535
- const platformOrganization = await queryAsAdminWithSuccess ( {
534
+ const platformOrganization = await adminQueryWithSuccess ( {
536
535
query : PLATFORM_ORGANIZATION_QUERY ,
537
536
variables : {
538
537
id : settingsInternalId ,
@@ -568,7 +567,7 @@ describe('Case Incident Response and organization sharing standard behavior with
568
567
} ) ;
569
568
it ( 'should Admin user activate Authorized Members' , async ( ) => {
570
569
userEditorId = await getUserIdByEmail ( USER_EDITOR . email ) ;
571
- const caseIRUpdatedQueryResult = await queryAsAdmin ( {
570
+ const caseIRUpdatedQueryResult = await adminQuery ( {
572
571
query : EDIT_AUTHORIZED_MEMBERS_QUERY ,
573
572
variables : {
574
573
id : caseIrId ,
@@ -605,7 +604,7 @@ describe('Case Incident Response and organization sharing standard behavior with
605
604
expect ( caseIRQueryResult ?. data ?. caseIncident . currentUserAccessRight ) . toEqual ( 'view' ) ;
606
605
} ) ;
607
606
it ( 'should Admin user deactivate authorized members' , async ( ) => {
608
- await queryAsAdmin ( {
607
+ await adminQuery ( {
609
608
query : EDIT_AUTHORIZED_MEMBERS_QUERY ,
610
609
variables : {
611
610
id : caseIrId ,
@@ -636,7 +635,7 @@ describe('Case Incident Response and organization sharing standard behavior with
636
635
} ) ;
637
636
it ( 'should plateform organization sharing and EE deactivated' , async ( ) => {
638
637
// Remove plateform organization
639
- const platformOrganization = await queryAsAdminWithSuccess ( {
638
+ const platformOrganization = await adminQueryWithSuccess ( {
640
639
query : PLATFORM_ORGANIZATION_QUERY ,
641
640
variables : {
642
641
id : settingsInternalId ,
0 commit comments