From 21d291dca5183f39d13d3f8e8d8690e88e8eb96a Mon Sep 17 00:00:00 2001 From: tianma-if Date: Wed, 14 Oct 2026 10:54:27 +0800 Subject: [PATCH] test(desktop): avoid filesystem order assumptions in share recovery --- apps/desktop/src/main/wechat-share-import.test.mjs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/desktop/src/main/wechat-share-import.test.mjs b/apps/desktop/src/main/wechat-share-import.test.mjs index 2ec26dd8..5fa09e3f 100644 --- a/apps/desktop/src/main/wechat-share-import.test.mjs +++ b/apps/desktop/src/main/wechat-share-import.test.mjs @@ -289,7 +289,10 @@ describe("WeChat share handoff", () => { }); await controller.importPending(); expect(prepared).toHaveLength(2); - await controller.finish(prepared[0].importId, false); + // Directory iteration order differs across filesystems; fail the named share. + const failedShare = prepared.find((payload) => payload.markdown.includes("first")); + expect(failedShare).toBeDefined(); + await controller.finish(failedShare.importId, false); const resumed = []; const restarted = createWeChatShareController({ downloadsPath: () => downloads,