|
| 1 | +<!doctype html> |
| 2 | +<html lang="en-US"> |
| 3 | + <head> |
| 4 | + <link href="/assets/index.css" rel="stylesheet" type="text/css" /> |
| 5 | + <script crossorigin="anonymous" src="https://unpkg.com/@babel/standalone/babel.min.js"></script> |
| 6 | + <script crossorigin=" anonymous" src=" https://unpkg.com/[email protected]/umd/react.production.min.js" ></script> |
| 7 | + <script crossorigin=" anonymous" src=" https://unpkg.com/[email protected]/umd/react-dom.production.min.js" ></script> |
| 8 | + <script crossorigin="anonymous" src="/test-harness.js"></script> |
| 9 | + <script crossorigin="anonymous" src="/test-page-object.js"></script> |
| 10 | + <script crossorigin="anonymous" src="/__dist__/webchat-es5.js"></script> |
| 11 | + <script crossorigin="anonymous" src="/__dist__/botframework-webchat-fluent-theme.production.min.js"></script> |
| 12 | + </head> |
| 13 | + <body> |
| 14 | + <main id="webchat"></main> |
| 15 | + <script type="text/babel"> |
| 16 | + run(async function () { |
| 17 | + const { |
| 18 | + React, |
| 19 | + ReactDOM: { render }, |
| 20 | + WebChat: { FluentThemeProvider, ReactWebChat } |
| 21 | + } = window; // Imports in UMD fashion. |
| 22 | + |
| 23 | + const { directLine, store } = testHelpers.createDirectLineEmulator(); |
| 24 | + |
| 25 | + const App = () => ( |
| 26 | + <ReactWebChat directLine={directLine} store={store} styleOptions={{ suggestedActionLayout: 'flow' }} /> |
| 27 | + ); |
| 28 | + |
| 29 | + render( |
| 30 | + <FluentThemeProvider> |
| 31 | + <App /> |
| 32 | + </FluentThemeProvider>, |
| 33 | + document.getElementById('webchat') |
| 34 | + ); |
| 35 | + |
| 36 | + await pageConditions.uiConnected(); |
| 37 | + |
| 38 | + await directLine.emulateIncomingActivity({ |
| 39 | + type: 'message', |
| 40 | + textFormat: 'plain', |
| 41 | + text: 'Please select one of the actions below', |
| 42 | + suggestedActions: { |
| 43 | + actions: [ |
| 44 | + { title: 'A', type: 'imBack' }, |
| 45 | + { title: 'B', type: 'imBack' }, |
| 46 | + { title: 'C', type: 'imBack' }, |
| 47 | + { title: 'D', type: 'imBack' }, |
| 48 | + { title: 'E', type: 'imBack' }, |
| 49 | + { title: 'F', type: 'imBack' }, |
| 50 | + { title: 'G', type: 'imBack' }, |
| 51 | + { title: 'H', type: 'imBack' }, |
| 52 | + { title: 'I', type: 'imBack' }, |
| 53 | + { title: 'J', type: 'imBack' }, |
| 54 | + { title: 'K', type: 'imBack' }, |
| 55 | + { title: 'L', type: 'imBack' }, |
| 56 | + { title: 'M', type: 'imBack' }, |
| 57 | + { title: 'N', type: 'imBack' }, |
| 58 | + { title: 'O', type: 'imBack' }, |
| 59 | + { title: 'P', type: 'imBack' }, |
| 60 | + { title: 'Q', type: 'imBack' }, |
| 61 | + { title: 'R', type: 'imBack' }, |
| 62 | + { title: 'S', type: 'imBack' }, |
| 63 | + { title: 'T', type: 'imBack' }, |
| 64 | + { title: 'U', type: 'imBack' }, |
| 65 | + { title: 'V', type: 'imBack' }, |
| 66 | + { title: 'W', type: 'imBack' }, |
| 67 | + { title: 'X', type: 'imBack' }, |
| 68 | + { title: 'Y', type: 'imBack' }, |
| 69 | + { title: 'Z', type: 'imBack' } |
| 70 | + ], |
| 71 | + to: [] |
| 72 | + } |
| 73 | + }); |
| 74 | + |
| 75 | + // THEN: Should render the activity. |
| 76 | + await host.snapshot(); |
| 77 | + }); |
| 78 | + </script> |
| 79 | + </body> |
| 80 | +</html> |
0 commit comments