|
11 | 11 | { |
12 | 12 | "imports": { |
13 | 13 | "botframework-webchat": "/__dist__/packages/bundle/static/botframework-webchat.js", |
14 | | - "jest-mock": "https://esm.sh/jest-mock", |
15 | | - "react": "/__dist__/packages/bundle/static/react.18.js", |
16 | | - "react-dom": "/__dist__/packages/bundle/static/react-dom.18.js", |
17 | | - "react-dom/client": "/__dist__/packages/bundle/static/react-dom.18/client.js" |
| 14 | + "react": "/__dist__/packages/bundle/static/react.baseline.js", |
| 15 | + "react-dom": "/__dist__/packages/bundle/static/react-dom.baseline.js", |
| 16 | + "react-dom/client": "/__dist__/packages/bundle/static/react-dom.baseline/client.js" |
18 | 17 | } |
19 | 18 | } |
20 | 19 | </script> |
21 | 20 | <script type="module"> |
22 | | - import { createDirectLine, createStoreWithOptions, ReactWebChat } from 'botframework-webchat'; |
23 | | - import { fn, spyOn } from 'jest-mock'; |
24 | | - import { createElement } from 'react'; |
25 | | - import { createRoot } from 'react-dom/client'; |
26 | | - |
27 | | - const consoleError = console.error.bind(console); |
28 | | - |
29 | | - spyOn(console, 'error').mockImplementation((...args) => { |
30 | | - const [message] = args; |
31 | | - |
32 | | - if ( |
33 | | - !( |
34 | | - typeof message === 'string' && |
35 | | - (message.includes( |
36 | | - 'Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.' |
37 | | - ) || |
38 | | - // TODO: [P0] We should fix the "Cannot update a component while rendering a different component" error. |
39 | | - (message.includes('Cannot update a component') && |
40 | | - message.includes('while rendering a different component'))) |
41 | | - ) |
42 | | - ) { |
43 | | - consoleError(...args); |
44 | | - } |
45 | | - }); |
| 21 | + import { createDirectLine, createStoreWithOptions, renderWebChat } from 'botframework-webchat'; |
| 22 | + import { createElement, version } from 'react'; |
46 | 23 |
|
47 | 24 | run(async function () { |
48 | 25 | const { |
|
54 | 31 |
|
55 | 32 | const { directLine, store } = createDirectLineEmulator(); |
56 | 33 |
|
57 | | - createRoot(document.getElementById('webchat')).render(createElement(ReactWebChat, { directLine, store })); |
| 34 | + renderWebChat({ directLine, store }, document.getElementById('webchat')); |
58 | 35 |
|
59 | 36 | await pageConditions.uiConnected(); |
60 | 37 |
|
|
65 | 42 | await host.snapshot('local'); |
66 | 43 |
|
67 | 44 | expect(typeof globalThis.React).toBe('undefined'); |
| 45 | + expect(version).toBe('16.8.6'); |
68 | 46 | }); |
69 | 47 | </script> |
70 | 48 | </body> |
|
0 commit comments