Skip to content

Commit

Permalink
ai fix
Browse files Browse the repository at this point in the history
  • Loading branch information
iamanishx committed Feb 17, 2025
1 parent 5b6771e commit 2bb4408
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions test/routes/graphql/Mutation/deletecomment.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ import { deleteCommentResolver } from "~/src/graphql/types/Mutation/deleteCommen
const validUuid = "11111111-1111-1111-1111-111111111111";
const validArgs = { input: { id: validUuid } };

// --- Helper: Create a full mock GraphQLContext ---
/**
* Creates a mock GraphQLContext for testing.
* @param overrides - Partial context to override default values
* @returns GraphQLContext with mocked functionality
*/

function createMockContext(
overrides: Partial<Required<GraphQLContext>> = {},
): GraphQLContext {
Expand Down Expand Up @@ -393,10 +398,11 @@ describe("GraphQL schema wiring", () => {
expect(calls.length).toBeGreaterThan(0);
if (calls[0] === undefined)
throw new Error("No calls found for deleteComment mutation");
const callback = calls[0][1] as (t: {
type BuilderCallback = (t: {
field: (config: unknown) => unknown;
arg: (config: unknown) => unknown;
}) => unknown;
const callback = calls[0][1] as BuilderCallback;
const dummyT = {
field: vi.fn().mockImplementation((config) => config),
arg: vi.fn().mockImplementation((config) => config),
Expand Down

0 comments on commit 2bb4408

Please sign in to comment.