@@ -5,24 +5,20 @@ import { initSeed } from '../../../testkit/seed';
5
5
6
6
const OrganizationWithOIDCIntegration = graphql ( `
7
7
query OrganizationWithOIDCIntegration($organizationSlug: String!) {
8
- organization(selector: { organizationSlug: $organizationSlug }) {
9
- organization {
8
+ organization(reference: { bySelector: { organizationSlug: $organizationSlug } }) {
9
+ id
10
+ oidcIntegration {
10
11
id
11
- oidcIntegration {
12
- id
13
- oidcUserAccessOnly
14
- }
12
+ oidcUserAccessOnly
15
13
}
16
14
}
17
15
}
18
16
` ) ;
19
17
20
18
const OrganizationReadTest = graphql ( `
21
19
query OrganizationReadTest($organizationSlug: String!) {
22
- organization(selector: { organizationSlug: $organizationSlug }) {
23
- organization {
24
- id
25
- }
20
+ organization(reference: { bySelector: { organizationSlug: $organizationSlug } }) {
21
+ id
26
22
}
27
23
}
28
24
` ) ;
@@ -119,12 +115,10 @@ describe('create', () => {
119
115
120
116
expect ( refetchedOrg ) . toEqual ( {
121
117
organization : {
122
- organization : {
123
- id : organization . id ,
124
- oidcIntegration : {
125
- id : result . createOIDCIntegration . ok ! . createdOIDCIntegration . id ,
126
- oidcUserAccessOnly : true ,
127
- } ,
118
+ id : organization . id ,
119
+ oidcIntegration : {
120
+ id : result . createOIDCIntegration . ok ! . createdOIDCIntegration . id ,
121
+ oidcUserAccessOnly : true ,
128
122
} ,
129
123
} ,
130
124
} ) ;
@@ -462,12 +456,10 @@ describe('delete', () => {
462
456
463
457
expect ( refetchedOrg ) . toEqual ( {
464
458
organization : {
465
- organization : {
466
- id : organization . id ,
467
- oidcIntegration : {
468
- id : oidcIntegrationId ,
469
- oidcUserAccessOnly : true ,
470
- } ,
459
+ id : organization . id ,
460
+ oidcIntegration : {
461
+ id : oidcIntegrationId ,
462
+ oidcUserAccessOnly : true ,
471
463
} ,
472
464
} ,
473
465
} ) ;
@@ -501,10 +493,8 @@ describe('delete', () => {
501
493
502
494
expect ( refetchedOrg ) . toEqual ( {
503
495
organization : {
504
- organization : {
505
- id : organization . id ,
506
- oidcIntegration : null ,
507
- } ,
496
+ id : organization . id ,
497
+ oidcIntegration : null ,
508
498
} ,
509
499
} ) ;
510
500
} ) ;
@@ -805,9 +795,7 @@ describe('restrictions', () => {
805
795
authToken : ownerToken ,
806
796
} ) . then ( r => r . expectNoGraphQLErrors ( ) ) ;
807
797
808
- expect ( refetchedOrg . organization ?. organization . oidcIntegration ?. oidcUserAccessOnly ) . toEqual (
809
- true ,
810
- ) ;
798
+ expect ( refetchedOrg . organization ?. oidcIntegration ?. oidcUserAccessOnly ) . toEqual ( true ) ;
811
799
812
800
const invitation = await inviteMember ( '[email protected] ' ) ;
813
801
const invitationCode = invitation . ok ?. code ;
@@ -847,9 +835,7 @@ describe('restrictions', () => {
847
835
authToken : ownerToken ,
848
836
} ) . then ( r => r . expectNoGraphQLErrors ( ) ) ;
849
837
850
- expect ( orgAfterOidc . organization ?. organization . oidcIntegration ?. oidcUserAccessOnly ) . toEqual (
851
- true ,
852
- ) ;
838
+ expect ( orgAfterOidc . organization ?. oidcIntegration ?. oidcUserAccessOnly ) . toEqual ( true ) ;
853
839
854
840
const restrictionsUpdateResult = await execute ( {
855
841
document : UpdateOIDCRestrictionsMutation ,
@@ -875,8 +861,7 @@ describe('restrictions', () => {
875
861
} ) . then ( r => r . expectNoGraphQLErrors ( ) ) ;
876
862
877
863
expect (
878
- orgAfterDisablingOidcRestrictions . organization ?. organization . oidcIntegration
879
- ?. oidcUserAccessOnly ,
864
+ orgAfterDisablingOidcRestrictions . organization ?. oidcIntegration ?. oidcUserAccessOnly ,
880
865
) . toEqual ( false ) ;
881
866
882
867
const invitation = await inviteMember ( '[email protected] ' ) ;
@@ -929,7 +914,7 @@ describe('restrictions', () => {
929
914
authToken : ownerToken ,
930
915
} ) . then ( r => r . expectNoGraphQLErrors ( ) ) ;
931
916
932
- expect ( readAccessCheck . organization ?. organization . id ) . toEqual ( organization . id ) ;
917
+ expect ( readAccessCheck . organization ?. id ) . toEqual ( organization . id ) ;
933
918
} ,
934
919
) ;
935
920
} ) ;
@@ -969,7 +954,7 @@ test.concurrent(
969
954
authToken : memberToken ,
970
955
} ) . then ( r => r . expectNoGraphQLErrors ( ) ) ;
971
956
972
- expect ( result . organization ! . organization . oidcIntegration ) . toEqual ( null ) ;
957
+ expect ( result . organization ! . oidcIntegration ) . toEqual ( null ) ;
973
958
974
959
await updateMemberRole ( role , [ 'oidc:modify' ] ) ;
975
960
@@ -981,6 +966,6 @@ test.concurrent(
981
966
authToken : memberToken ,
982
967
} ) . then ( r => r . expectNoGraphQLErrors ( ) ) ;
983
968
984
- expect ( result . organization ! . organization . oidcIntegration ) . not . toEqual ( null ) ;
969
+ expect ( result . organization ! . oidcIntegration ) . not . toEqual ( null ) ;
985
970
} ,
986
971
) ;
0 commit comments