@@ -6,8 +6,11 @@ import { useRouter } from 'next/navigation'
66import { act } from 'react'
77import { render } from 'wrappers/testUtil'
88import About from 'app/about/page'
9- import { GET_PROJECT_METADATA , GET_TOP_CONTRIBUTORS } from 'server/queries/projectQueries'
10- import { GET_LEADER_DATA } from 'server/queries/userQueries'
9+ import {
10+ GetProjectMetadataDocument ,
11+ GetTopContributorsDocument ,
12+ } from 'types/__generated__/projectQueries.generated'
13+ import { GetLeaderDataDocument } from 'types/__generated__/userQueries.generated'
1114
1215jest . mock ( '@apollo/client/react' , ( ) => ( {
1316 ...jest . requireActual ( '@apollo/client/react' ) ,
@@ -116,15 +119,15 @@ describe('About Component', () => {
116119 ; ( useQuery as unknown as jest . Mock ) . mockImplementation ( ( query , options ) => {
117120 const key = options ?. variables ?. key
118121
119- if ( query === GET_PROJECT_METADATA ) {
122+ if ( query === GetProjectMetadataDocument ) {
120123 if ( key === 'nest' ) {
121124 return mockProjectData
122125 }
123- } else if ( query === GET_TOP_CONTRIBUTORS ) {
126+ } else if ( query === GetTopContributorsDocument ) {
124127 if ( key === 'nest' ) {
125128 return mockTopContributorsData
126129 }
127- } else if ( query === GET_LEADER_DATA ) {
130+ } else if ( query === GetLeaderDataDocument ) {
128131 return mockUserData ( key )
129132 }
130133
@@ -530,7 +533,7 @@ describe('About Component', () => {
530533
531534 test ( 'triggers toaster error when GraphQL request fails for project' , async ( ) => {
532535 ; ( useQuery as unknown as jest . Mock ) . mockImplementation ( ( query , options ) => {
533- if ( query === GET_PROJECT_METADATA && options ?. variables ?. key === 'nest' ) {
536+ if ( query === GetProjectMetadataDocument && options ?. variables ?. key === 'nest' ) {
534537 return { loading : false , data : null , error : new Error ( 'GraphQL error' ) }
535538 }
536539 return {
@@ -556,7 +559,7 @@ describe('About Component', () => {
556559
557560 test ( 'triggers toaster error when GraphQL request fails for topContributors' , async ( ) => {
558561 ; ( useQuery as unknown as jest . Mock ) . mockImplementation ( ( query , options ) => {
559- if ( query === GET_TOP_CONTRIBUTORS && options ?. variables ?. key === 'nest' ) {
562+ if ( query === GetTopContributorsDocument && options ?. variables ?. key === 'nest' ) {
560563 return { loading : false , data : null , error : new Error ( 'GraphQL error' ) }
561564 }
562565 return {
0 commit comments