|
| 1 | +<!doctype html> |
| 2 | +<html lang="en-US"> |
| 3 | + <head> |
| 4 | + <link href="/assets/index.css" rel="stylesheet" type="text/css" /> |
| 5 | + <style type="text/css"> |
| 6 | + /* TODO: [P*] Can we eliminate this style? */ |
| 7 | + .fui-FluentProvider, |
| 8 | + .webchat-fluent { |
| 9 | + height: 100%; |
| 10 | + } |
| 11 | + </style> |
| 12 | + </head> |
| 13 | + <body> |
| 14 | + <event-stream-adapter id="adapter" href="./stream.txt" compat="webchat"></event-stream-adapter> |
| 15 | + <main id="webchat"></main> |
| 16 | + <script type="importmap"> |
| 17 | + { |
| 18 | + "imports": { |
| 19 | + "@fluentui/react-provider": "/__dist__/packages/test/test-assets/out/@fluentui/react-provider.js", |
| 20 | + "@fluentui/tokens": "/__dist__/packages/test/test-assets/out/@fluentui/tokens.js", |
| 21 | + "botframework-webchat": "/__dist__/packages/bundle/static/botframework-webchat.js", |
| 22 | + "botframework-webchat/component": "/__dist__/packages/bundle/static/botframework-webchat/component.js", |
| 23 | + "botframework-webchat/decorator": "/__dist__/packages/bundle/static/botframework-webchat/decorator.js", |
| 24 | + "botframework-webchat/hook": "/__dist__/packages/bundle/static/botframework-webchat/hook.js", |
| 25 | + "botframework-webchat/internal": "/__dist__/packages/bundle/static/botframework-webchat/internal.js", |
| 26 | + "botframework-webchat-core": "/__dist__/packages/bundle/static/botframework-webchat-core.js", |
| 27 | + "botframework-webchat-fluent-theme": "/__dist__/packages/fluent-theme/static/botframework-webchat-fluent-theme.js", |
| 28 | + "eventsource-parser": "https://esm.sh/eventsource-parser", |
| 29 | + "eventsource-parser/": "https://esm.sh/eventsource-parser/", |
| 30 | + "iter-fest": "https://esm.sh/iter-fest", |
| 31 | + "react": "https://esm.sh/react@18", |
| 32 | + "react-dom": "https://esm.sh/react-dom@18", |
| 33 | + "react-dom/": "https://esm.sh/react-dom@18/", |
| 34 | + "react-jsx-runtime": "https://esm.sh/react@18/jsx-runtime" |
| 35 | + } |
| 36 | + } |
| 37 | + </script> |
| 38 | + <script type="module"> |
| 39 | + import { run, host, pageConditions, testHelpers } from '/assets/esm/test.js'; |
| 40 | + |
| 41 | + import { registerElements } from '/assets/custom-element/custom-element.js'; |
| 42 | + import { FluentProvider } from '@fluentui/react-provider'; |
| 43 | + import { webLightTheme } from '@fluentui/tokens'; |
| 44 | + import { createStoreWithOptions, ReactWebChat, testIds } from 'botframework-webchat'; |
| 45 | + import { FluentThemeProvider } from 'botframework-webchat-fluent-theme'; |
| 46 | + import { createElement } from 'react'; |
| 47 | + import { createRoot } from 'react-dom/client'; |
| 48 | + |
| 49 | + await registerElements('event-stream-adapter'); |
| 50 | + |
| 51 | + testHelpers.hideKnownError(); |
| 52 | + |
| 53 | + const store = testHelpers.createStore(); |
| 54 | + |
| 55 | + run(async function () { |
| 56 | + const { directLine } = adapter; |
| 57 | + |
| 58 | + const fluentTheme = { |
| 59 | + ...webLightTheme, |
| 60 | + // Original is #242424 which is too light for fui-FluentProvider to pass our accessibility checks. |
| 61 | + colorNeutralForeground1: '#1b1b1b' |
| 62 | + }; |
| 63 | + |
| 64 | + createRoot(document.getElementsByTagName('main')[0]).render( |
| 65 | + createElement( |
| 66 | + FluentProvider, |
| 67 | + { className: 'fui-FluentProvider', theme: fluentTheme }, |
| 68 | + createElement( |
| 69 | + FluentThemeProvider, |
| 70 | + { variant: 'fluent' }, |
| 71 | + createElement(ReactWebChat, { directLine, store }) |
| 72 | + ) |
| 73 | + ) |
| 74 | + ); |
| 75 | + |
| 76 | + await pageConditions.uiConnected(); |
| 77 | + |
| 78 | + await host.snapshot('local'); |
| 79 | + }, { skipCheckAccessibility: true }); |
| 80 | + |
| 81 | + // TODO: figure out why skip doesn;t work with fluent |
| 82 | + window.checkAccessibility = async () => {} |
| 83 | + </script> |
| 84 | + </body> |
| 85 | +</html> |
0 commit comments