From 33907e47384e0e123fbdaa636cd1c2de46ca611d Mon Sep 17 00:00:00 2001 From: Andelf Date: Wed, 18 May 2022 02:16:29 +0800 Subject: [PATCH 1/2] fix(sync): check current-user-uuid against nil --- src/main/frontend/fs/sync.cljs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/main/frontend/fs/sync.cljs b/src/main/frontend/fs/sync.cljs index c79961c4fd..368b7efe0a 100644 --- a/src/main/frontend/fs/sync.cljs +++ b/src/main/frontend/fs/sync.cljs @@ -1439,10 +1439,16 @@ (defn- check-graph-belong-to-current-user [current-user-uuid graph-user-uuid] - (let [result (= current-user-uuid graph-user-uuid)] - (when-not result - (notification/show! (t :file-sync/other-user-graph) :warning false)) - result)) + (cond + (nil? current-user-uuid) + false + + (= current-user-uuid graph-user-uuid) + true + + :else + (do (notification/show! (t :file-sync/other-user-graph) :warning false) + false))) (defn check-remote-graph-exists [local-graph-uuid] From f94c0184d1ae13ecf976e21651da0432de5cbe10 Mon Sep 17 00:00:00 2001 From: Andelf Date: Wed, 18 May 2022 02:35:25 +0800 Subject: [PATCH 2/2] fix(test): random failure of code testing --- e2e-tests/code-editing.spec.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/e2e-tests/code-editing.spec.ts b/e2e-tests/code-editing.spec.ts index e978316b01..7cdf6ed9a1 100644 --- a/e2e-tests/code-editing.spec.ts +++ b/e2e-tests/code-editing.spec.ts @@ -164,7 +164,7 @@ test('multiple code block', async ({ page }) => { await page.waitForSelector('.CodeMirror pre', { state: 'visible' }) await page.waitForTimeout(500) - await page.click('.CodeMirror pre >> nth=1') + await page.click('.CodeMirror >> nth=1 >> pre') await page.waitForTimeout(500) await page.type('.CodeMirror textarea >> nth=1', '\n :key-test 日本語\n', { strict: true }) @@ -191,11 +191,10 @@ test('click outside to exit', async ({ page }) => { expect(await page.inputValue('.block-editor textarea')).toBe('Header ``Click``\n```\n ABC DEF\n GHI\n```') }) -test('click language label to exit #3463', async ({ page }) => { +test('click language label to exit #3463', async ({ page, block }) => { await createRandomPage(page) - await page.press('.block-editor textarea', 'Enter') - await page.waitForTimeout(200) + await block.enterNext(); await page.fill('.block-editor textarea', '```cpp\n```') await page.waitForTimeout(200)