From a0aeb86413ff6fb624452b56979c535b5c915678 Mon Sep 17 00:00:00 2001 From: Tian Yuan Date: Thu, 25 Jul 2024 13:45:00 +0800 Subject: [PATCH] refactor: update aad test case (#12056) * refactor: update aad test case * refactor: update test case * refactor: update aad test case --- .../tests/component/driver/aad/create.test.ts | 6 ++++++ .../component/driver/botAadApp/create.test.ts | 15 +++++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/packages/fx-core/tests/component/driver/aad/create.test.ts b/packages/fx-core/tests/component/driver/aad/create.test.ts index 62f0fe9e04..38c2a541da 100644 --- a/packages/fx-core/tests/component/driver/aad/create.test.ts +++ b/packages/fx-core/tests/component/driver/aad/create.test.ts @@ -752,6 +752,9 @@ describe("aadAppCreate", async () => { expect(result.result._unsafeUnwrap().get("MY_CLIENT_SECRET")).to.equal(expectedSecretText); expect(result.result._unsafeUnwrap().size).to.equal(6); expect(result.summaries.length).to.equal(2); + expect(result.summaries[0]).includes( + `Teams toolkit will delete the Microsoft Entra application after debugging` + ); }); it("should not output delete aad information when using non microsoft tenant", async () => { @@ -798,6 +801,9 @@ describe("aadAppCreate", async () => { expect(result.summaries).includes( `Generated client secret for Microsoft Entra application with object id ${expectedObjectId}` ); + expect(result.summaries).not.includes( + "Teams toolkit will delete the Microsoft Entra application after debugging" + ); }); it("should not output delete aad information when return non login information", async () => { diff --git a/packages/fx-core/tests/component/driver/botAadApp/create.test.ts b/packages/fx-core/tests/component/driver/botAadApp/create.test.ts index 4312c45f6f..b4bcf2e672 100644 --- a/packages/fx-core/tests/component/driver/botAadApp/create.test.ts +++ b/packages/fx-core/tests/component/driver/botAadApp/create.test.ts @@ -339,10 +339,11 @@ describe("botAadAppCreate", async () => { outputEnvVarNames ); - console.log(JSON.stringify(result)); - expect(result.output.get(outputKeys.botId)).to.be.equal(expectedClientId); expect(result.output.get(outputKeys.botPassword)).to.be.equal(expectedSecretText); + expect(result.summaries[0]).includes( + "Teams toolkit will delete the Microsoft Entra application after debugging" + ); }); it("should not output delete aad information when using non microsoft tenant", async () => { @@ -367,10 +368,11 @@ describe("botAadAppCreate", async () => { outputEnvVarNames ); - console.log(JSON.stringify(result)); - expect(result.output.get(outputKeys.botId)).to.be.equal(expectedClientId); expect(result.output.get(outputKeys.botPassword)).to.be.equal(expectedSecretText); + expect(result.summaries[0]).not.includes( + "Teams toolkit will delete the Microsoft Entra application after debugging" + ); }); it("should not output delete aad information when using non login information", async () => { @@ -395,9 +397,10 @@ describe("botAadAppCreate", async () => { outputEnvVarNames ); - console.log(JSON.stringify(result)); - expect(result.output.get(outputKeys.botId)).to.be.equal(expectedClientId); expect(result.output.get(outputKeys.botPassword)).to.be.equal(expectedSecretText); + expect(result.summaries[0]).not.includes( + "Teams toolkit will delete the Microsoft Entra application after debugging" + ); }); });