From 34fc0b16b5a751382bf3ee91a9b3a14a35642657 Mon Sep 17 00:00:00 2001 From: Max Kurapov Date: Thu, 31 Oct 2024 17:21:46 +0100 Subject: [PATCH] chore(auth): fix test with new apollo types --- packages/auth/src/graphql/resolvers/grant.test.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/auth/src/graphql/resolvers/grant.test.ts b/packages/auth/src/graphql/resolvers/grant.test.ts index e72e5fd7d2..50afb44936 100644 --- a/packages/auth/src/graphql/resolvers/grant.test.ts +++ b/packages/auth/src/graphql/resolvers/grant.test.ts @@ -518,7 +518,7 @@ describe('Grant Resolvers', (): void => { } catch (error) { assert.ok(error instanceof ApolloError) expect(error.message).toBe('No grant') - expect(error.graphQLErrors[0].extensions.code).toEqual( + expect(error.graphQLErrors[0].extensions?.code).toEqual( GraphQLErrorCode.NotFound ) } @@ -590,7 +590,7 @@ describe('Grant Resolvers', (): void => { } catch (error) { assert.ok(error instanceof ApolloError) expect(error.message).toBe('Grant id is not provided') - expect(error.graphQLErrors[0].extensions.code).toEqual( + expect(error.graphQLErrors[0].extensions?.code).toEqual( GraphQLErrorCode.Forbidden ) } @@ -626,7 +626,7 @@ describe('Grant Resolvers', (): void => { } catch (error) { assert.ok(error instanceof ApolloError) expect(error.message).toBe('Revoke grant was not successful') - expect(error.graphQLErrors[0].extensions.code).toEqual( + expect(error.graphQLErrors[0].extensions?.code).toEqual( GraphQLErrorCode.NotFound ) } @@ -662,7 +662,7 @@ describe('Grant Resolvers', (): void => { }) } catch (error) { assert.ok(error instanceof ApolloError) - expect(error.graphQLErrors[0].extensions.code).toEqual( + expect(error.graphQLErrors[0].extensions?.code).toEqual( GraphQLErrorCode.InternalServerError ) }