-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Expand file tree
/
Copy pathariaLabel.fluent.html
More file actions
91 lines (81 loc) · 3.8 KB
/
ariaLabel.fluent.html
File metadata and controls
91 lines (81 loc) · 3.8 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<!doctype html>
<html lang="en-US">
<head>
<link href="/assets/index.css" rel="stylesheet" type="text/css" />
<style type="text/css">
/* TODO: [P*] Can we eliminate this style? */
.fui-FluentProvider,
.webchat-fluent {
height: 100%;
}
</style>
</head>
<body>
<main id="webchat"></main>
<!-- Redirect packages on esm.sh loaded by `@fluentui/react-components` -->
<script type="importmap">
{
"imports": {
"@fluentui/react-components": "https://esm.sh/@fluentui/react-components?deps=react@18.3.1,react-dom@18.3.1&exports=FluentProvider,createDarkTheme,webLightTheme",
"botframework-webchat": "/__dist__/packages/bundle/static/botframework-webchat.js",
"botframework-webchat/component": "/__dist__/packages/bundle/static/botframework-webchat/component.js",
"botframework-webchat/decorator": "/__dist__/packages/bundle/static/botframework-webchat/decorator.js",
"botframework-webchat/hook": "/__dist__/packages/bundle/static/botframework-webchat/hook.js",
"botframework-webchat/internal": "/__dist__/packages/bundle/static/botframework-webchat/internal.js",
"botframework-webchat-fluent-theme": "/__dist__/packages/fluent-theme/static/botframework-webchat-fluent-theme.js",
"react": "/__dist__/packages/bundle/static/react.js",
"react-dom": "/__dist__/packages/bundle/static/react-dom.js",
"react-dom/client": "/__dist__/packages/bundle/static/react-dom/client.js",
"https://esm.sh/react@18.3.1/es2022/react.mjs": "/__dist__/packages/bundle/static/react.js",
"https://esm.sh/react@18.3.1/es2022/react-dom.mjs": "/__dist__/packages/bundle/static/react-dom.18.js",
"https://esm.sh/react@18.3.1/es2022/react-dom/client.mjs": "/__dist__/packages/bundle/static/react-dom.18/client.js"
}
}
</script>
<script type="module">
import '/test-harness.mjs';
import '/test-page-object.mjs';
import { FluentProvider, webLightTheme } from '@fluentui/react-components';
import { createDirectLine, createStoreWithOptions, hooks, ReactWebChat } from 'botframework-webchat';
import { FluentThemeProvider } from 'botframework-webchat-fluent-theme';
import { createElement } from 'react';
import { createRoot } from 'react-dom/client';
const { useStyleOptions } = hooks;
const {
testHelpers: { createDirectLineEmulator }
} = window;
// TODO: This is for `createDirectLineEmulator` only, should find ways to eliminate this line.
window.WebChat = { createStoreWithOptions };
testHelpers.hideKnownError();
run(async function () {
const { directLine, store } = createDirectLineEmulator();
const fluentTheme = {
...webLightTheme,
// Original is #242424 which is too light for fui-FluentProvider to pass our accessibility checks.
colorNeutralForeground1: '#1b1b1b'
};
createRoot(document.getElementsByTagName('main')[0]).render(
createElement(
FluentProvider,
{ className: 'fui-FluentProvider', theme: fluentTheme },
createElement(
FluentThemeProvider,
{ variant: 'fluent' },
createElement(ReactWebChat, {
directLine,
overrideLocalizedStrings: {
TEXT_INPUT_ALT: 'Hello, World!'
},
store
})
)
)
);
await pageConditions.uiConnected();
const sendBoxTextBox = document.querySelector('[data-testid="send box text area"]');
expect(sendBoxTextBox.tagName).toBe('TEXTAREA');
expect(sendBoxTextBox.getAttribute('aria-label')).toBe('Hello, World!');
});
</script>
</body>
</html>