Skip to content

Commit

Permalink
refactor: update aad test case (#12056)
Browse files Browse the repository at this point in the history
* refactor: update aad test case

* refactor: update test case

* refactor: update aad test case
  • Loading branch information
xiaolang124 committed Jul 25, 2024
1 parent e84b7e8 commit a0aeb86
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
6 changes: 6 additions & 0 deletions packages/fx-core/tests/component/driver/aad/create.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down Expand Up @@ -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 () => {
Expand Down
15 changes: 9 additions & 6 deletions packages/fx-core/tests/component/driver/botAadApp/create.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand All @@ -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 () => {
Expand All @@ -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"
);
});
});

0 comments on commit a0aeb86

Please sign in to comment.