fix: update recurringGroupId assignment and improve type definitions in helpers
This commit is contained in:
@@ -1,10 +1,16 @@
|
||||
import { beforeEach, expect, mock, test } from 'bun:test';
|
||||
|
||||
import { Errors } from '@/lib/errors';
|
||||
import { err, ok } from '@/lib/result';
|
||||
import { type Result, err, ok } from '@/lib/result';
|
||||
import type { InviteComplexUserResponse } from '@repo/api-contract';
|
||||
|
||||
const inviteComplexUserMock = mock(async () => undefined as unknown as InviteComplexUserResponse);
|
||||
type InviteComplexUserFn = (
|
||||
userId: string,
|
||||
complexId: string,
|
||||
input: { email: string }
|
||||
) => Promise<Result<InviteComplexUserResponse>>;
|
||||
|
||||
const inviteComplexUserMock = mock<InviteComplexUserFn>(async () => undefined as never);
|
||||
|
||||
const { createInviteComplexUserHandler } = await import(
|
||||
'@/modules/complex/features/invite-complex-user/invite-complex-user.handler'
|
||||
|
||||
@@ -10,8 +10,8 @@ const createSportMock = mock(async (_input: CreateSportInput) =>
|
||||
name: 'Tenis',
|
||||
slug: 'tenis',
|
||||
isActive: true,
|
||||
createdAt: '2026-04-23T00:00:00.000Z',
|
||||
updatedAt: '2026-04-23T00:00:00.000Z',
|
||||
createdAt: new Date('2026-04-23T00:00:00.000Z'),
|
||||
updatedAt: new Date('2026-04-23T00:00:00.000Z'),
|
||||
})
|
||||
);
|
||||
|
||||
@@ -56,8 +56,8 @@ test('returns 201 with the created sport', async () => {
|
||||
name: 'Tenis',
|
||||
slug: 'tenis',
|
||||
isActive: true,
|
||||
createdAt: '2026-04-23T00:00:00.000Z',
|
||||
updatedAt: '2026-04-23T00:00:00.000Z',
|
||||
createdAt: new Date('2026-04-23T00:00:00.000Z'),
|
||||
updatedAt: new Date('2026-04-23T00:00:00.000Z'),
|
||||
} as const;
|
||||
|
||||
createSportMock.mockResolvedValue(ok(createdSport));
|
||||
|
||||
Reference in New Issue
Block a user