fix: update recurringGroupId assignment and improve type definitions in helpers

This commit is contained in:
Jose Selesan
2026-06-26 14:58:40 -03:00
parent c7e685ea08
commit ab69711e87
7 changed files with 33 additions and 14 deletions

View File

@@ -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'

View File

@@ -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));