mirror of
https://github.com/bookorbit/bookorbit.git
synced 2026-11-03 00:11:37 -06:00
test(stats): read continue-listening books from the scroller envelope
The scroller route returns a DashboardScrollerResponse of books and total, but this spec still parsed the body as a bare array, so it failed before reaching its assertions.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { randomUUID } from 'crypto';
|
||||
|
||||
import { and, eq } from 'drizzle-orm';
|
||||
import type { AudiobookManifest, AudiobookPlaybackState } from '@bookorbit/types';
|
||||
import type { AudiobookManifest, AudiobookPlaybackState, DashboardScrollerResponse } from '@bookorbit/types';
|
||||
|
||||
import * as schema from '../src/db/schema';
|
||||
import {
|
||||
@@ -48,7 +48,7 @@ describe('Dashboard continue-listening scroller (e2e)', { timeout: SCENARIO_TIME
|
||||
headers: authHeader(reader.accessToken),
|
||||
});
|
||||
expect(response.statusCode).toBe(200);
|
||||
return (response.json() as Array<{ id: number }>).map((book) => book.id);
|
||||
return response.json<DashboardScrollerResponse>().books.map((book) => book.id);
|
||||
}
|
||||
|
||||
async function getReadStatus(): Promise<string | null> {
|
||||
|
||||
Reference in New Issue
Block a user