Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
test('invites the user to Gatsby’s GitHub org if necessary', async () => {
axios
.mockResolvedValueOnce(mockShopifyCustomerCreateSuccess)
.mockResolvedValueOnce(mockShopifyAddTagsSuccess);
gh.search.issues.mockResolvedValueOnce(mockGitHubIssueSearchResult);
gh.orgs.getTeamMembership.mockRejectedValueOnce({ code: 404 });
await resolvers.Mutation.createContributor(null, contributorInput);
expect(gh.orgs.addTeamMembership).toBeCalled();
});
test('invites the user to Gatsby’s GitHub org if necessary', async () => {
axios
.mockResolvedValueOnce(mockShopifyCustomerCreateSuccess)
.mockResolvedValueOnce(mockShopifyAddTagsSuccess);
gh.search.issues.mockResolvedValueOnce(mockGitHubIssueSearchResult);
gh.orgs.getTeamMembership.mockRejectedValueOnce({ code: 404 });
await resolvers.Mutation.createContributor(null, contributorInput);
expect(gh.orgs.addTeamMembership).toBeCalled();
});