Skip to content

Commit

Permalink
Add unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Corina Gum committed Jan 9, 2024
1 parent e3151f5 commit d742b53
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions js/packages/teams-ai/src/Application.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,23 @@ describe('Application', () => {
}
}

it('should start signin flow', async () => {
const app = new Application({
adapter,
botAppId: 'botid',
authentication: authenticationSettings
});
await adapter.sendTextToBot('signin', async (context) => {
// Set MockUserTokenClient on TurnState
context.turnState.set(
(context.adapter as CloudAdapterBase).UserTokenClientKey,
new MockUserTokenClient()
);
const handled = await app.run(context);
assert.equal(handled, true);
});
});

it('should skip signin flow when user is already signed in.', async () => {
const app = new Application({
adapter,
Expand Down

0 comments on commit d742b53

Please sign in to comment.