From 98147f8154e80ff95d65b198d7e50dfc2041b130 Mon Sep 17 00:00:00 2001 From: Wesley Finck Date: Fri, 24 Oct 2025 15:48:52 -0700 Subject: [PATCH] fix: add missing `getUrlCardBasic` method to mock repositories and correct DTO type Co-authored-by: aider (anthropic/claude-sonnet-4-20250514) --- .../infrastructure/repositories/DrizzleCardQueryRepository.ts | 2 +- .../cards/tests/application/GetCollectionPageUseCase.test.ts | 1 + .../cards/tests/application/GetLibrariesForUrlUseCase.test.ts | 1 + .../cards/tests/application/GetMyUrlCardsUseCase.test.ts | 1 + .../cards/tests/application/GetUrlCardViewUseCase.test.ts | 1 + 5 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/modules/cards/infrastructure/repositories/DrizzleCardQueryRepository.ts b/src/modules/cards/infrastructure/repositories/DrizzleCardQueryRepository.ts index 4c75b860..93f89ec4 100644 --- a/src/modules/cards/infrastructure/repositories/DrizzleCardQueryRepository.ts +++ b/src/modules/cards/infrastructure/repositories/DrizzleCardQueryRepository.ts @@ -61,7 +61,7 @@ export class DrizzleCardQueryRepository implements ICardQueryRepository { async getUrlCardBasic( cardId: string, callingUserId?: string, - ): Promise { + ): Promise { return this.urlCardQueryService.getUrlCardBasic(cardId, callingUserId); } diff --git a/src/modules/cards/tests/application/GetCollectionPageUseCase.test.ts b/src/modules/cards/tests/application/GetCollectionPageUseCase.test.ts index 6b3fd03d..d91eb734 100644 --- a/src/modules/cards/tests/application/GetCollectionPageUseCase.test.ts +++ b/src/modules/cards/tests/application/GetCollectionPageUseCase.test.ts @@ -755,6 +755,7 @@ describe('GetCollectionPageUseCase', () => { .fn() .mockRejectedValue(new Error('Query failed')), getUrlCardView: jest.fn(), + getUrlCardBasic: jest.fn(), getLibrariesForCard: jest.fn(), getLibrariesForUrl: jest.fn(), getNoteCardsForUrl: jest.fn(), diff --git a/src/modules/cards/tests/application/GetLibrariesForUrlUseCase.test.ts b/src/modules/cards/tests/application/GetLibrariesForUrlUseCase.test.ts index e3119bc0..c586ee2f 100644 --- a/src/modules/cards/tests/application/GetLibrariesForUrlUseCase.test.ts +++ b/src/modules/cards/tests/application/GetLibrariesForUrlUseCase.test.ts @@ -363,6 +363,7 @@ describe('GetLibrariesForUrlUseCase', () => { getUrlCardsOfUser: jest.fn(), getCardsInCollection: jest.fn(), getUrlCardView: jest.fn(), + getUrlCardBasic: jest.fn(), getLibrariesForCard: jest.fn(), getLibrariesForUrl: jest .fn() diff --git a/src/modules/cards/tests/application/GetMyUrlCardsUseCase.test.ts b/src/modules/cards/tests/application/GetMyUrlCardsUseCase.test.ts index aac80b19..a2feed6e 100644 --- a/src/modules/cards/tests/application/GetMyUrlCardsUseCase.test.ts +++ b/src/modules/cards/tests/application/GetMyUrlCardsUseCase.test.ts @@ -626,6 +626,7 @@ describe('GetUrlCardsUseCase', () => { getUrlCardView: jest .fn() .mockRejectedValue(new Error('Database connection failed')), + getUrlCardBasic: jest.fn(), getLibrariesForCard: jest.fn(), getLibrariesForUrl: jest.fn(), getNoteCardsForUrl: jest.fn(), diff --git a/src/modules/cards/tests/application/GetUrlCardViewUseCase.test.ts b/src/modules/cards/tests/application/GetUrlCardViewUseCase.test.ts index 1752c462..de758bc8 100644 --- a/src/modules/cards/tests/application/GetUrlCardViewUseCase.test.ts +++ b/src/modules/cards/tests/application/GetUrlCardViewUseCase.test.ts @@ -478,6 +478,7 @@ describe('GetUrlCardViewUseCase', () => { getUrlCardView: jest .fn() .mockRejectedValue(new Error('Database connection failed')), + getUrlCardBasic: jest.fn(), getLibrariesForCard: jest.fn(), getLibrariesForUrl: jest.fn(), getNoteCardsForUrl: jest.fn(), -- 2.51.2