website refactor

This commit is contained in:
2026-01-16 18:21:06 +01:00
parent 2f53727702
commit 095885544b
146 changed files with 970 additions and 524 deletions

View File

@@ -26,11 +26,6 @@ describe('UpdateTeamUseCase', () => {
getMembership: vi.fn().mockResolvedValue(mockMembership),
} as unknown as TeamMembershipRepository;
const present = vi.fn<(data: UpdateTeamResult) => void>();
const output: { present: typeof present } = {
present,
};
const useCase = new UpdateTeamUseCase(mockTeamRepository, mockMembershipRepository);
const command: UpdateTeamInput = {
@@ -78,7 +73,6 @@ describe('UpdateTeamUseCase', () => {
const error = result.unwrapErr() as ApplicationErrorCode<UpdateTeamErrorCode, { message: string }>;
expect(error.code).toBe('PERMISSION_DENIED');
expect(error.details?.message).toBe('User does not have permission to update this team');
expect(present).not.toHaveBeenCalled();
});
it('returns error if team not found', async () => {
@@ -94,11 +88,6 @@ describe('UpdateTeamUseCase', () => {
getMembership: vi.fn().mockResolvedValue(mockMembership),
} as unknown as TeamMembershipRepository;
const present = vi.fn<(data: UpdateTeamResult) => void>();
const output: { present: typeof present } = {
present,
};
const useCase = new UpdateTeamUseCase(mockTeamRepository, mockMembershipRepository);
const command: UpdateTeamInput = {
@@ -113,7 +102,6 @@ describe('UpdateTeamUseCase', () => {
const error = result.unwrapErr() as ApplicationErrorCode<UpdateTeamErrorCode, { message: string }>;
expect(error.code).toBe('TEAM_NOT_FOUND');
expect(error.details?.message).toBe('Team not found');
expect(present).not.toHaveBeenCalled();
});
it('returns repository error on unexpected failure', async () => {
@@ -129,11 +117,6 @@ describe('UpdateTeamUseCase', () => {
getMembership: vi.fn().mockResolvedValue(mockMembership),
} as unknown as TeamMembershipRepository;
const present = vi.fn<(data: UpdateTeamResult) => void>();
const output: { present: typeof present } = {
present,
};
const useCase = new UpdateTeamUseCase(mockTeamRepository, mockMembershipRepository);
const command: UpdateTeamInput = {
@@ -148,6 +131,5 @@ describe('UpdateTeamUseCase', () => {
const error = result.unwrapErr() as ApplicationErrorCode<UpdateTeamErrorCode, { message: string }>;
expect(error.code).toBe('REPOSITORY_ERROR');
expect(error.details?.message).toBe('db error');
expect(present).not.toHaveBeenCalled();
});
});