@@ -119,8 +119,8 @@ describe('getDataConnect()', () => {
119119 /** @auth (level: PUBLIC) */
120120 const queryListUsers = 'query ListUsers @auth(level: PUBLIC) { users { id, name, address } }' ;
121121 /** @auth (level: NO_ACCESS) */
122- const queryListEmails =
123- 'query ListEmails @auth(level: NO_ACCESS) { emails { id subject text date from { name } } }' ;
122+ // const queryListEmails =
123+ // 'query ListEmails @auth(level: NO_ACCESS) { emails { id subject text date from { name } } }';
124124 /** no @auth specified - default permissions */
125125 const queryGetUserById = 'query GetUser($id: User_Key!) { user(key: $id) { id name } }' ;
126126
@@ -131,8 +131,8 @@ describe('getDataConnect()', () => {
131131 }` ;
132132
133133 const multipleQueries = `
134- ${ queryListUsers }
135- ${ queryListEmails }
134+ ${ queryListUsersPublicLevel }
135+ ${ queryListEmailsNoAccess }
136136 ` ;
137137
138138 /** hardcoded upsert fredUser query, with non-impersonateable id */
@@ -307,7 +307,7 @@ describe('getDataConnect()', () => {
307307 'claims' ,
308308 async ( ) => {
309309 const resp = await getDataConnect ( connectorConfig ) . executeGraphql < ListUsersResponse , undefined > (
310- queryListUsersImpersonation , optsNonExistingClaims ) ;
310+ queryListUsersImpersonationUserLevel , optsNonExistingClaims ) ;
311311 // Should find no data
312312 expect ( resp . data . users ) . to . be . empty ;
313313 } ) ;
@@ -339,7 +339,7 @@ describe('getDataConnect()', () => {
339339 describe ( 'PUBLIC Auth Policy' , ( ) => {
340340 it ( 'executeGraphql() successfully executes an impersonated query with authenticated claims' , async ( ) => {
341341 const resp = await getDataConnect ( connectorConfig ) . executeGraphql < ListUsersResponse , undefined > (
342- queryListUsers , optsAuthorizedFredClaims ) ;
342+ queryListUsersPublicLevel , optsAuthorizedFredClaims ) ;
343343 expect ( resp . data . users ) . to . be . not . empty ;
344344 expect ( resp . data . users . length ) . to . be . greaterThan ( 1 ) ;
345345 resp . data . users . forEach ( ( user ) => {
@@ -349,7 +349,7 @@ describe('getDataConnect()', () => {
349349
350350 it ( 'executeGraphql() successfully executes an impersonated query with unauthenticated claims' , async ( ) => {
351351 const resp = await getDataConnect ( connectorConfig ) . executeGraphql < ListUsersResponse , undefined > (
352- queryListUsers , optsUnauthorizedClaims ) ;
352+ queryListUsersPublicLevel , optsUnauthorizedClaims ) ;
353353 expect ( resp . data . users ) . to . be . not . empty ;
354354 expect ( resp . data . users . length ) . to . be . greaterThan ( 1 ) ;
355355 resp . data . users . forEach ( ( user ) => {
@@ -360,7 +360,7 @@ describe('getDataConnect()', () => {
360360 it ( 'executeGraphql() successfully executes an impersonated query with non-existing authenticated claims' ,
361361 async ( ) => {
362362 const resp = await getDataConnect ( connectorConfig ) . executeGraphql < ListUsersResponse , undefined > (
363- queryListUsers , optsNonExistingClaims ) ;
363+ queryListUsersPublicLevel , optsNonExistingClaims ) ;
364364 expect ( resp . data . users ) . to . be . not . empty ;
365365 expect ( resp . data . users . length ) . to . be . greaterThan ( 1 ) ;
366366 resp . data . users . forEach ( ( user ) => {
@@ -371,18 +371,18 @@ describe('getDataConnect()', () => {
371371
372372 describe ( 'NO_ACCESS Auth Policy' , ( ) => {
373373 it ( 'executeGraphql() should throw for an impersonated query with authenticated claims' , async ( ) => {
374- return await getDataConnect ( connectorConfig ) . executeGraphql ( queryListEmails , optsAuthorizedFredClaims )
374+ return await getDataConnect ( connectorConfig ) . executeGraphql ( queryListEmailsNoAccess , optsAuthorizedFredClaims )
375375 . should . eventually . be . rejected . and . has . property ( 'code' , 'data-connect/permission-denied' ) ;
376376 } ) ;
377377
378378 it ( 'executeGraphql() should throw for an impersonated query with unauthenticated claims' , async ( ) => {
379- return await getDataConnect ( connectorConfig ) . executeGraphql ( queryListEmails , optsUnauthorizedClaims )
379+ return await getDataConnect ( connectorConfig ) . executeGraphql ( queryListEmailsNoAccess , optsUnauthorizedClaims )
380380 . should . eventually . be . rejected . and . has . property ( 'code' , 'data-connect/permission-denied' ) ;
381381 } ) ;
382382
383383 it ( 'executeGraphql() should throw for an impersonated query with non-existing authenticated claims' ,
384384 async ( ) => {
385- return await getDataConnect ( connectorConfig ) . executeGraphql ( queryListEmails , optsNonExistingClaims )
385+ return await getDataConnect ( connectorConfig ) . executeGraphql ( queryListEmailsNoAccess , optsNonExistingClaims )
386386 . should . eventually . be . rejected . and . has . property ( 'code' , 'data-connect/permission-denied' ) ;
387387 } ) ;
388388 } ) ;
0 commit comments