-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Expand file tree
/
Copy pathfluentThemeFallback.html
More file actions
76 lines (67 loc) · 2.62 KB
/
fluentThemeFallback.html
File metadata and controls
76 lines (67 loc) · 2.62 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<!doctype html>
<html lang="en-US">
<head>
<link href="/assets/index.css" rel="stylesheet" type="text/css" />
<script crossorigin="anonymous" src="https://unpkg.com/@babel/standalone@7.8.7/babel.min.js"></script>
<script crossorigin="anonymous" src="/test-harness.js"></script>
<script crossorigin="anonymous" src="/test-page-object.js"></script>
<script crossorigin="anonymous" src="/__dist__/fluent-bundle.production.min.js"></script>
<script crossorigin="anonymous" src="/__dist__/webchat-es5.js"></script>
<script crossorigin="anonymous" src="/__dist__/botframework-webchat-fluent-theme.production.min.js"></script>
<style>
.fui-FluentProvider {
display: contents;
}
</style>
</head>
<body>
<main id="webchat"></main>
<script type="text/babel">
run(async function () {
const {
React,
ReactDOMClient: { createRoot },
WebChat: { FluentThemeProvider, ReactWebChat },
Fluent: { FluentProvider, webLightTheme}
} = window; // Imports in UMD fashion.
const { directLine, store } = testHelpers.createDirectLineEmulator();
const App = () => <ReactWebChat directLine={directLine} store={store} />;
const root = createRoot(document.getElementById('webchat'));
root.render(
<FluentProvider theme={webLightTheme}>
<FluentThemeProvider>
<App />
</FluentThemeProvider>
</FluentProvider>
);
await pageConditions.uiConnected();
await directLine.emulateIncomingActivity(
'Eiusmod anim adipisicing cupidatat adipisicing officia sint qui consequat veniam id aute.'
);
await pageConditions.numActivitiesShown(1);
document.querySelector(`[data-testid="${WebChat.testIds.sendBoxTextBox}"]`).focus();
await (await directLine.actPostActivity(() => host.sendKeys('Hello, World!\n'))).resolveAll();
await directLine.emulateIncomingActivity({
type: 'message',
textFormat: 'plain',
text: 'Please select one of the actions below',
suggestedActions: {
actions: [
{
displayText: 'Aloha',
text: 'echo Hello',
title: 'Message back as string with display text',
type: 'messageBack'
}
],
to: []
}
});
// THEN: Should send the activity.
await pageConditions.numActivitiesShown(3);
await pageConditions.allOutgoingActivitiesSent();
await host.snapshot();
});
</script>
</body>
</html>