From 0fb96a68010188509af19e166012b5e408faf21e Mon Sep 17 00:00:00 2001 From: Sherry Date: Fri, 3 May 2024 12:05:17 +0800 Subject: [PATCH] [lexical-utils] ci: fix typing to fix integrity test (#6019) --- .../src/__tests__/unit/LexicalNodeHelpers.test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/lexical-utils/src/__tests__/unit/LexicalNodeHelpers.test.ts b/packages/lexical-utils/src/__tests__/unit/LexicalNodeHelpers.test.ts index 8740dc14048..b86fdc01ebe 100644 --- a/packages/lexical-utils/src/__tests__/unit/LexicalNodeHelpers.test.ts +++ b/packages/lexical-utils/src/__tests__/unit/LexicalNodeHelpers.test.ts @@ -207,7 +207,7 @@ describe('LexicalNodeHelpers tests', () => { test('DFS of empty ParagraphNode returns only itself', async () => { const editor: LexicalEditor = testEnv.editor; - let paragraphKey; + let paragraphKey: string; await editor.update(() => { const root = $getRoot(); @@ -224,10 +224,10 @@ describe('LexicalNodeHelpers tests', () => { await editor.update(() => { const paragraph = $getNodeByKey(paragraphKey); - expect($dfs(paragraph)).toEqual([ + expect($dfs(paragraph ?? undefined)).toEqual([ { depth: 1, - node: paragraph.getLatest(), + node: paragraph?.getLatest(), }, ]); });