@@ -5,24 +5,20 @@ import { initSeed } from '../../../testkit/seed';
55
66const OrganizationWithOIDCIntegration = graphql ( `
77 query OrganizationWithOIDCIntegration($organizationSlug: String!) {
8- organization(selector: { organizationSlug: $organizationSlug }) {
9- organization {
8+ organization(reference: { bySelector: { organizationSlug: $organizationSlug } }) {
9+ id
10+ oidcIntegration {
1011 id
11- oidcIntegration {
12- id
13- oidcUserAccessOnly
14- }
12+ oidcUserAccessOnly
1513 }
1614 }
1715 }
1816` ) ;
1917
2018const OrganizationReadTest = graphql ( `
2119 query OrganizationReadTest($organizationSlug: String!) {
22- organization(selector: { organizationSlug: $organizationSlug }) {
23- organization {
24- id
25- }
20+ organization(reference: { bySelector: { organizationSlug: $organizationSlug } }) {
21+ id
2622 }
2723 }
2824` ) ;
@@ -119,12 +115,10 @@ describe('create', () => {
119115
120116 expect ( refetchedOrg ) . toEqual ( {
121117 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 ,
128122 } ,
129123 } ,
130124 } ) ;
@@ -462,12 +456,10 @@ describe('delete', () => {
462456
463457 expect ( refetchedOrg ) . toEqual ( {
464458 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 ,
471463 } ,
472464 } ,
473465 } ) ;
@@ -501,10 +493,8 @@ describe('delete', () => {
501493
502494 expect ( refetchedOrg ) . toEqual ( {
503495 organization : {
504- organization : {
505- id : organization . id ,
506- oidcIntegration : null ,
507- } ,
496+ id : organization . id ,
497+ oidcIntegration : null ,
508498 } ,
509499 } ) ;
510500 } ) ;
@@ -805,9 +795,7 @@ describe('restrictions', () => {
805795 authToken : ownerToken ,
806796 } ) . then ( r => r . expectNoGraphQLErrors ( ) ) ;
807797
808- expect ( refetchedOrg . organization ?. organization . oidcIntegration ?. oidcUserAccessOnly ) . toEqual (
809- true ,
810- ) ;
798+ expect ( refetchedOrg . organization ?. oidcIntegration ?. oidcUserAccessOnly ) . toEqual ( true ) ;
811799
812800 const invitation = await inviteMember ( '[email protected] ' ) ; 813801 const invitationCode = invitation . ok ?. code ;
@@ -847,9 +835,7 @@ describe('restrictions', () => {
847835 authToken : ownerToken ,
848836 } ) . then ( r => r . expectNoGraphQLErrors ( ) ) ;
849837
850- expect ( orgAfterOidc . organization ?. organization . oidcIntegration ?. oidcUserAccessOnly ) . toEqual (
851- true ,
852- ) ;
838+ expect ( orgAfterOidc . organization ?. oidcIntegration ?. oidcUserAccessOnly ) . toEqual ( true ) ;
853839
854840 const restrictionsUpdateResult = await execute ( {
855841 document : UpdateOIDCRestrictionsMutation ,
@@ -875,8 +861,7 @@ describe('restrictions', () => {
875861 } ) . then ( r => r . expectNoGraphQLErrors ( ) ) ;
876862
877863 expect (
878- orgAfterDisablingOidcRestrictions . organization ?. organization . oidcIntegration
879- ?. oidcUserAccessOnly ,
864+ orgAfterDisablingOidcRestrictions . organization ?. oidcIntegration ?. oidcUserAccessOnly ,
880865 ) . toEqual ( false ) ;
881866
882867 const invitation = await inviteMember ( '[email protected] ' ) ; @@ -929,7 +914,7 @@ describe('restrictions', () => {
929914 authToken : ownerToken ,
930915 } ) . then ( r => r . expectNoGraphQLErrors ( ) ) ;
931916
932- expect ( readAccessCheck . organization ?. organization . id ) . toEqual ( organization . id ) ;
917+ expect ( readAccessCheck . organization ?. id ) . toEqual ( organization . id ) ;
933918 } ,
934919 ) ;
935920} ) ;
@@ -969,7 +954,7 @@ test.concurrent(
969954 authToken : memberToken ,
970955 } ) . then ( r => r . expectNoGraphQLErrors ( ) ) ;
971956
972- expect ( result . organization ! . organization . oidcIntegration ) . toEqual ( null ) ;
957+ expect ( result . organization ! . oidcIntegration ) . toEqual ( null ) ;
973958
974959 await updateMemberRole ( role , [ 'oidc:modify' ] ) ;
975960
@@ -981,6 +966,6 @@ test.concurrent(
981966 authToken : memberToken ,
982967 } ) . then ( r => r . expectNoGraphQLErrors ( ) ) ;
983968
984- expect ( result . organization ! . organization . oidcIntegration ) . not . toEqual ( null ) ;
969+ expect ( result . organization ! . oidcIntegration ) . not . toEqual ( null ) ;
985970 } ,
986971) ;
0 commit comments