From e90854b031243548310c5af321fa869cc9dd1928 Mon Sep 17 00:00:00 2001 From: Kisaragi Marine Date: Fri, 21 Jun 2024 05:04:20 +0900 Subject: [PATCH] runtime non-null assertion --- packages/backend/test/e2e/note.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/backend/test/e2e/note.ts b/packages/backend/test/e2e/note.ts index 9bfcfffdcbe9..eb50a468b8d1 100644 --- a/packages/backend/test/e2e/note.ts +++ b/packages/backend/test/e2e/note.ts @@ -365,6 +365,7 @@ describe('Note', () => { assert.strictEqual(Array.isArray(res.body), true); const myNote = res.body.find((note: { id: string; files: { id: string }[] }) => note.id === createdNote.body.createdNote.id); assert.ok(myNote); + assert.ok(myNote.files); assert.strictEqual(myNote.files.length, 1); assert.strictEqual(myNote.files[0].id, file.body!.id); }); @@ -390,6 +391,8 @@ describe('Note', () => { assert.strictEqual(Array.isArray(res.body), true); const myNote = res.body.find((note: { id: string }) => note.id === renoted.body.createdNote.id); assert.ok(myNote); + assert.ok(myNote.renote); + assert.ok(myNote.renote.files); assert.strictEqual(myNote.renote.files.length, 1); assert.strictEqual(myNote.renote.files[0].id, file.body!.id); }); @@ -416,6 +419,8 @@ describe('Note', () => { assert.strictEqual(Array.isArray(res.body), true); const myNote = res.body.find((note: { id: string }) => note.id === reply.body.createdNote.id); assert.ok(myNote); + assert.ok(myNote.reply); + assert.ok(myNote.reply.files); assert.strictEqual(myNote.reply.files.length, 1); assert.strictEqual(myNote.reply.files[0].id, file.body!.id); }); @@ -447,6 +452,9 @@ describe('Note', () => { assert.strictEqual(Array.isArray(res.body), true); const myNote = res.body.find((note: { id: string }) => note.id === renoted.body.createdNote.id); assert.ok(myNote); + assert.ok(myNote.renote); + assert.ok(myNote.renote.reply); + assert.ok(myNote.renote.reply.files); assert.strictEqual(myNote.renote.reply.files.length, 1); assert.strictEqual(myNote.renote.reply.files[0].id, file.body!.id); });