#133 Fix: Typfehler im public-Kommentar-Test (noUncheckedIndexedAccess)
body.threads[0] ist unter noUncheckedIndexedAccess möglicherweise undefined; per Destrukturierung + Non-null-Assertion nach dem toHaveLength(1)-Check geglättet. (Der Fehler rutschte durch, weil der #133-Commit nach dem Nachtragen des Tests nicht erneut getypecheckt wurde.) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0155v2aT8AG1kZDQEZiCLBWC
This commit is contained in:
parent
f014a61480
commit
a84e9880bd
@ -131,8 +131,9 @@ describe.skipIf(!hasTestDb)('public read access (e2e, issue #56)', () => {
|
|||||||
};
|
};
|
||||||
expect(body.openCount).toBe(1);
|
expect(body.openCount).toBe(1);
|
||||||
expect(body.threads).toHaveLength(1);
|
expect(body.threads).toHaveLength(1);
|
||||||
expect(body.threads[0].root.body).toBe('A public remark');
|
const [thread] = body.threads;
|
||||||
expect(body.threads[0].replies.map((r) => r.body)).toEqual(['A public reply']);
|
expect(thread!.root.body).toBe('A public remark');
|
||||||
|
expect(thread!.replies.map((r) => r.body)).toEqual(['A public reply']);
|
||||||
|
|
||||||
// A non-public page never reveals its comments either.
|
// A non-public page never reveals its comments either.
|
||||||
await api().get(`/api/v1/public/${privatePondSlug}/${privatePageSlug}/comments`).expect(404);
|
await api().get(`/api/v1/public/${privatePondSlug}/${privatePageSlug}/comments`).expect(404);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user