website refactor
This commit is contained in:
@@ -134,14 +134,16 @@ class MockUserRatingRepository {
|
||||
}
|
||||
}
|
||||
|
||||
import { CreateRatingEventDto } from '../dtos/CreateRatingEventDto';
|
||||
|
||||
// Mock AppendRatingEventsUseCase
|
||||
class MockAppendRatingEventsUseCase {
|
||||
constructor(
|
||||
private ratingEventRepository: any,
|
||||
private userRatingRepository: any
|
||||
private ratingEventRepository: MockRatingEventRepository,
|
||||
private userRatingRepository: MockUserRatingRepository
|
||||
) {}
|
||||
|
||||
async execute(input: any): Promise<any> {
|
||||
async execute(input: { userId: string; events: CreateRatingEventDto[] }): Promise<{ events: string[]; snapshotUpdated: boolean }> {
|
||||
const events: RatingEvent[] = [];
|
||||
|
||||
// Create events from input
|
||||
@@ -195,7 +197,6 @@ describe('Admin Vote Session Use Cases', () => {
|
||||
// Use dates relative to current time so close() works
|
||||
const now = new Date(Date.now() - 86400000); // Yesterday
|
||||
const tomorrow = new Date(Date.now() + 86400000); // Tomorrow
|
||||
const dayAfter = new Date(Date.now() + 86400000 * 2); // Day after tomorrow
|
||||
|
||||
beforeEach(() => {
|
||||
mockSessionRepo = new MockAdminVoteSessionRepository();
|
||||
|
||||
Reference in New Issue
Block a user