forked from microsoft/BotFramework-WebChat
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathcomponents.html
More file actions
51 lines (44 loc) · 1.71 KB
/
components.html
File metadata and controls
51 lines (44 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<!doctype html>
<html lang="en-US">
<head>
<link href="/assets/index.css" rel="stylesheet" type="text/css" />
</head>
<body>
<main id="webchat"></main>
<script type="importmap">
{
"imports": {
"botframework-webchat": "/__dist__/packages/bundle/static/botframework-webchat.js",
"jest-mock": "https://esm.sh/jest-mock",
"react": "/__dist__/packages/bundle/static/react.js",
"react-dom": "/__dist__/packages/bundle/static/react-dom.js"
}
}
</script>
<script type="module">
import { fn, spyOn } from 'jest-mock';
spyOn(console, 'warn');
</script>
<script type="module">
import '/test-harness.mjs';
import '/test-page-object.mjs';
import { Components, createDirectLine, createStoreWithOptions, renderWebChat } from 'botframework-webchat';
import { version } from 'react';
run(async function () {
expect(console.warn).toHaveBeenCalledTimes(0);
// WHEN: Touching "Components.BasicWebChat".
expect(Components.BasicWebChat).not.toBeUndefined();
// THEN: Should show deprecation note.
expect(console.warn).toHaveBeenCalledTimes(1);
expect(console.warn).toHaveBeenLastCalledWith(
"botframework-webchat: `import { Components } from 'botframework-webchat'` has been deprecated, use `import { %s } from 'botframework-webchat/component'` instead.",
'BasicWebChat'
);
// WHEN: Touching "Components.BasicTranscript".
expect(Components.BasicWebChat).not.toBeUndefined();
// THEN: Should not show deprecation note again.
expect(console.warn).toHaveBeenCalledTimes(1);
});
</script>
</body>
</html>