chore: drop stray reader-dashboard test from this branch
All checks were successful
CI / Semgrep Security Scan (pull_request) Successful in 23s
CI / Compose Bucket Idempotency (pull_request) Successful in 1m2s
CI / Unit & Component Tests (pull_request) Successful in 3m31s
CI / OCR Service Tests (pull_request) Successful in 20s
CI / Backend Unit Tests (pull_request) Successful in 3m53s
CI / fail2ban Regex (pull_request) Successful in 41s
All checks were successful
CI / Semgrep Security Scan (pull_request) Successful in 23s
CI / Compose Bucket Idempotency (pull_request) Successful in 1m2s
CI / Unit & Component Tests (pull_request) Successful in 3m31s
CI / OCR Service Tests (pull_request) Successful in 20s
CI / Backend Unit Tests (pull_request) Successful in 3m53s
CI / fail2ban Regex (pull_request) Successful in 41s
page.server.spec.ts picked up an unrelated reader-dashboard test case via a cross-session staging race; restore it to match main so this PR only touches the import-normalizer tool + docs. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -394,51 +394,6 @@ describe('home page load — reader branch (isReader = !canWrite && !canAnnotate
|
|||||||
expect(result.isReader).toBe(false);
|
expect(result.isReader).toBe(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('maps search result items directly to recentDocs without wrapping in a .document property', async () => {
|
|
||||||
const searchItem = {
|
|
||||||
id: 'd1',
|
|
||||||
title: 'Liebesbrief',
|
|
||||||
originalFilename: 'letter.pdf',
|
|
||||||
completionPercentage: 80,
|
|
||||||
receivers: [],
|
|
||||||
tags: [],
|
|
||||||
contributors: [],
|
|
||||||
matchData: { titleOffsets: [], senderMatched: false }
|
|
||||||
};
|
|
||||||
const mockGet = vi
|
|
||||||
.fn()
|
|
||||||
.mockResolvedValueOnce({ response: { ok: true, status: 200 }, data: [] }) // initial persons
|
|
||||||
.mockResolvedValueOnce({
|
|
||||||
response: { ok: true },
|
|
||||||
data: { totalDocuments: 1, totalPersons: 1 }
|
|
||||||
}) // stats
|
|
||||||
.mockResolvedValueOnce({ response: { ok: true }, data: [] }) // topPersons
|
|
||||||
.mockResolvedValueOnce({
|
|
||||||
response: { ok: true },
|
|
||||||
data: { items: [searchItem], totalElements: 1, pageNumber: 0, pageSize: 5, totalPages: 1 }
|
|
||||||
}) // search
|
|
||||||
.mockResolvedValueOnce({ response: { ok: true }, data: [] }); // stories
|
|
||||||
vi.mocked(createApiClient).mockReturnValue({ GET: mockGet } as ReturnType<
|
|
||||||
typeof createApiClient
|
|
||||||
>);
|
|
||||||
|
|
||||||
const result = await load({
|
|
||||||
url: makeUrl(),
|
|
||||||
request: new Request('http://localhost/'),
|
|
||||||
fetch: vi.fn() as unknown as typeof fetch,
|
|
||||||
parent: vi
|
|
||||||
.fn()
|
|
||||||
.mockResolvedValue({ canWrite: false, canAnnotate: false, canBlogWrite: false })
|
|
||||||
} as Parameters<typeof load>[0]);
|
|
||||||
|
|
||||||
expect(result.isReader).toBe(true);
|
|
||||||
if (result.isReader) {
|
|
||||||
expect(result.recentDocs).toHaveLength(1);
|
|
||||||
expect(result.recentDocs[0]).toBeDefined();
|
|
||||||
expect(result.recentDocs[0].id).toBe('d1');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
it('returns topPersons=[] when topPersons fetch fails, rest of data still loads', async () => {
|
it('returns topPersons=[] when topPersons fetch fails, rest of data still loads', async () => {
|
||||||
const okStats = {
|
const okStats = {
|
||||||
response: { ok: true, status: 200 },
|
response: { ok: true, status: 200 },
|
||||||
|
|||||||
Reference in New Issue
Block a user