diff --git a/plugins/github-issues/src/hooks/useGetIssuesBeRepoFromGitHub.test.tsx b/plugins/github-issues/src/hooks/useGetIssuesBeRepoFromGitHub.test.tsx index 3784481b22..e02a7d2ea0 100644 --- a/plugins/github-issues/src/hooks/useGetIssuesBeRepoFromGitHub.test.tsx +++ b/plugins/github-issues/src/hooks/useGetIssuesBeRepoFromGitHub.test.tsx @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -const mockGraphQLQuery = jest.fn(() => 'ti ri ri ri ra!'); +const mockGraphQLQuery = jest.fn(() => ({})); jest.mock('./useOctokitGraphQL', () => ({ useOctokitGraphQL: jest.fn(() => mockGraphQLQuery), })); @@ -22,84 +22,77 @@ import React from 'react'; import { render } from '@testing-library/react'; import { useGetIssuesByRepoFromGitHub } from './useGetIssuesByRepoFromGitHub'; -// fragment issues on Repository { -// issues( -// states: OPEN -// first: 40 -// orderBy: { field: UPDATED_AT, direction: DESC } -// ) { -// totalCount -// edges { -// cursor -// node { -// assignees(first: 10) { -// edges { -// node { -// avatarUrl -// login -// } -// } -// } -// author { -// login -// avatarUrl -// url -// } -// repository { -// nameWithOwner -// } -// body -// title -// url -// participants { -// totalCount -// } -// updatedAt -// createdAt -// comments(last: 1) { -// totalCount -// } -// } -// } -// } -// } - -// query { -// rateLimit { -// cost -// remaining -// } - -// yomovie: repository(name: "yo-movie", owner: "mrwolny") { -// ...issues -// } -// , -// yoanchor: repository(name: "yo-anchor", owner: "mrwolny") { -// ...issues -// } -// , -// yomoviex: repository(name: "yo-movie", owner: "mrwolny") { -// ...issues -// } -// , -// yoanchorx: repository(name: "yo-anchor", owner: "mrwolny") { -// ...issues -// } - -// } - describe('useGetIssuesBeRepoFromGitHub', () => { - it('should rock!', async () => { + it('should call GitHub API with correct query with fragment for each repo', async () => { const Helper = () => { const getIssues = useGetIssuesByRepoFromGitHub(); getIssues(['mrwolny/yo-yo', 'mrwolny/yoyo'], 10); - return <>>; + return
; }; render(