-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added the Web Chat Version and Bundle to User Agent (#2101)
* Added WebChat Version to BotAgent * Minor changes to botAgent and revert misc eslint changes * Revert eslint change * Added warning message * removed eslint changes * Update packages/bundle/src/index-es5.ts Co-Authored-By: William Wong <compulim@users.noreply.github.com> * Update packages/bundle/src/index-minimal.ts Co-Authored-By: William Wong <compulim@users.noreply.github.com> * Update packages/bundle/src/index.ts Co-Authored-By: William Wong <compulim@users.noreply.github.com> * Added tests for createDirectLine * Updated test description
- Loading branch information
Showing
7 changed files
with
82 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
jest.mock('botframework-directlinejs', () => { | ||
class DirectLine { | ||
constructor({ botAgent }) { | ||
this.botAgent = botAgent; | ||
} | ||
} | ||
|
||
return { DirectLine }; | ||
}); | ||
|
||
import * as WebChatFull from '../index'; | ||
import * as WebChatMinimal from '../index-minimal'; | ||
import * as WebChatES5 from '../index-es5'; | ||
|
||
describe('Web Chat createDirectLine', () => { | ||
it('for full bundle', () => { | ||
const directLine = WebChatFull.createDirectLine({}); | ||
expect(directLine.botAgent).toBe(`WebChat/${WebChatFull.version} (Full)`); | ||
}); | ||
|
||
it('for minimal bundle', () => { | ||
const directLine = WebChatMinimal.createDirectLine({}); | ||
expect(directLine.botAgent).toBe(`WebChat/${WebChatMinimal.version} (Minimal)`); | ||
}); | ||
|
||
it('for ES5 bundle', () => { | ||
const directLine = WebChatES5.createDirectLine({}); | ||
expect(directLine.botAgent).toBe(`WebChat/${WebChatES5.version} (ES5)`); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters