From 66bbf3f5b2503a246329d8d26cf943601a5fb6bc Mon Sep 17 00:00:00 2001 From: EmmaYuan1015 Date: Mon, 29 Jun 2026 10:19:19 +0800 Subject: [PATCH] Add setNewArch test for second quick pick cancellation --- test/extension/commands/setNewArch.test.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/extension/commands/setNewArch.test.ts b/test/extension/commands/setNewArch.test.ts index 19f1e6773..a4b754830 100644 --- a/test/extension/commands/setNewArch.test.ts +++ b/test/extension/commands/setNewArch.test.ts @@ -215,4 +215,18 @@ suite("setNewArchCommand", function () { assert.strictEqual(writeFileStub.called, false); assert.strictEqual(spawnStub.called, false); }); + + test("should return without writing when new architecture selection is cancelled", async function () { + const showQuickPickStub = Sinon.stub(); + showQuickPickStub.onFirstCall().returns(Promise.resolve("Android")); + showQuickPickStub.onSecondCall().returns(Promise.resolve(undefined)); + const writeFileStub = Sinon.stub().returns(Promise.resolve()); + const spawnStub = Sinon.stub().returns(Promise.resolve()); + const { SetNewArch } = createCommandModule(showQuickPickStub, writeFileStub, spawnStub); + + await runCommand(SetNewArch); + + assert.strictEqual(writeFileStub.called, false); + assert.strictEqual(spawnStub.called, false); + }); });