From fa6abbdf41a86f553ac88299d16ab935360b522b Mon Sep 17 00:00:00 2001 From: 4gray Date: Sun, 27 Sep 2026 21:07:54 +0200 Subject: [PATCH] test(playback): pass the spec type-check gate from master - playback-data-access: align tsconfig.spec.json with the epg-data-access config #1705 updated (bundler resolution, global.d.ts for window.electron). - M3U recent-history spec: type the selectSignal override. Co-Authored-By: Claude Opus 5.5 --- libs/playback/data-access/tsconfig.spec.json | 6 +++--- .../lib/video-player/video-player-recent-history.spec.ts | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/libs/playback/data-access/tsconfig.spec.json b/libs/playback/data-access/tsconfig.spec.json index 7f31bb031..71dd0db03 100644 --- a/libs/playback/data-access/tsconfig.spec.json +++ b/libs/playback/data-access/tsconfig.spec.json @@ -3,12 +3,12 @@ "compilerOptions": { "emitDecoratorMetadata": false, "outDir": "../../../dist/out-tsc", - "module": "commonjs", + "module": "preserve", "target": "es2016", "types": ["jest", "node"], - "moduleResolution": "node10" + "moduleResolution": "bundler" }, - "files": ["src/test-setup.ts"], + "files": ["src/test-setup.ts", "../../../global.d.ts"], "include": [ "jest.config.ts", "src/**/*.test.ts", diff --git a/libs/playlist/m3u/feature-player/src/lib/video-player/video-player-recent-history.spec.ts b/libs/playlist/m3u/feature-player/src/lib/video-player/video-player-recent-history.spec.ts index 93643cc16..845dc0ce8 100644 --- a/libs/playlist/m3u/feature-player/src/lib/video-player/video-player-recent-history.spec.ts +++ b/libs/playlist/m3u/feature-player/src/lib/video-player/video-player-recent-history.spec.ts @@ -59,7 +59,7 @@ describe('VideoPlayerComponent — recently viewed history', () => { let component: VideoPlayerComponentInstance; let gate: PlaybackHistoryGate; const activePlaylist = signal | null>(null); - const harnessSelectSignal = storeMock.selectSignal.getMockImplementation(); + const harnessSelectSignal = storeMock.selectSignal.getMockImplementation()!; beforeAll(async () => { ({ VideoPlayerComponent } = await import('./video-player.component')); @@ -74,11 +74,11 @@ describe('VideoPlayerComponent — recently viewed history', () => { externalSession.set(null); storeMock.dispatch.mockClear(); activePlaylist.set({ _id: 'playlist-1', recentlyViewed: [] }); - storeMock.selectSignal.mockImplementation((selector: unknown) => + // The harness has no playlist meta; the history write updates it. + storeMock.selectSignal.mockImplementation(((selector: unknown) => selector === selectActivePlaylist ? activePlaylist - : harnessSelectSignal?.(selector) - ); + : harnessSelectSignal(selector)) as typeof harnessSelectSignal); playlistsServiceMock.addM3uRecentlyViewed.mockClear(); await TestBed.configureTestingModule({