refactor(tests): update remaining test files for ephemeral team model

This commit is contained in:
2026-04-03 22:00:01 -07:00
parent 9137fabc2b
commit eeb0f7970a
7 changed files with 76 additions and 85 deletions
+8 -8
View File
@@ -11,10 +11,10 @@ import { prisma } from '@/lib/prisma';
import type { User, Player } from '@prisma/client';
// Create mock functions at module level
const getSessionMock = mock(() => {});
const userFindUniqueMock = mock(() => {});
const userUpdateMock = mock(() => {});
const playerFindUniqueMock = mock(() => {});
const getSessionMock = mock(async (): Promise<any> => null);
const userFindUniqueMock = mock(async (): Promise<any> => null);
const userUpdateMock = mock(async (): Promise<any> => ({}));
const playerFindUniqueMock = mock(async (): Promise<any> => null);
// Mock the getSession and prisma functions
mock.module('@/lib/auth-simple', () => ({
@@ -63,10 +63,10 @@ const createMockPlayer = (id: number, name: string): Player => ({
describe('User Management', () => {
beforeEach(() => {
// Reset mock implementations to default (no-op) before each test
getSessionMock.mockImplementation(() => undefined);
userFindUniqueMock.mockImplementation(() => undefined);
userUpdateMock.mockImplementation(() => undefined);
playerFindUniqueMock.mockImplementation(() => undefined);
getSessionMock.mockImplementation(async () => undefined);
userFindUniqueMock.mockImplementation(async () => undefined);
userUpdateMock.mockImplementation(async () => undefined);
playerFindUniqueMock.mockImplementation(async () => undefined);
});
describe('User Name Editing', () => {