Skip to content

Commit 7351b1c

Browse files
committed
Add references visibility style option
1 parent f231b54 commit 7351b1c

20 files changed

Lines changed: 166 additions & 24 deletions
-6.18 KB
Loading
27.1 KB
Loading

__tests__/html2/activity/citation.longRef.html

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
run(async function () {
1616
const { directLine, store } = testHelpers.createDirectLineEmulator();
1717

18-
renderWebChat(
18+
const { isCopilotVariant } = renderWebChat(
1919
{
2020
directLine,
2121
store
@@ -70,6 +70,14 @@
7070

7171
expect(markdownButtons[0].getAttribute('type')).toBe('button');
7272

73+
// When (copilot): opening the link definitions
74+
if (isCopilotVariant) {
75+
await host.click(pageElements.linkDefinitions()[0].querySelector('summary'));
76+
77+
// Then (copilot): the link definitions should be opened
78+
await host.snapshot('local');
79+
}
80+
7381
const linkDefinitionItems = pageElements.linkDefinitions()[0].querySelectorAll('[role="listitem"] > *');
7482

7583
expect(linkDefinitionItems[0].getAttribute('href')).toBe(
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
<title>Citation accordion (copilot)</title>
5+
<script>
6+
location = './accordion?variant=copilot';
7+
</script>
8+
</head>
9+
<body></body>
10+
</html>
13.3 KB
Loading
18.3 KB
Loading
13.3 KB
Loading

__tests__/html2/citation/accordion.html

Lines changed: 52 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,66 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en-US">
33
<head>
44
<link href="/assets/index.css" rel="stylesheet" type="text/css" />
5+
<script type="importmap">
6+
{
7+
"imports": {
8+
"@fluentui/react-provider": "/__dist__/packages/test/test-assets/out/@fluentui/react-provider.js",
9+
"@fluentui/tokens": "/__dist__/packages/test/test-assets/out/@fluentui/tokens.js",
10+
"react": "https://esm.sh/react@18",
11+
"react-dom": "https://esm.sh/react-dom@18",
12+
"react-dom/": "https://esm.sh/react-dom@18/",
13+
"react-jsx-runtime": "https://esm.sh/react@18/jsx-runtime"
14+
}
15+
}
16+
</script>
517
<script crossorigin="anonymous" src="/test-harness.js"></script>
618
<script crossorigin="anonymous" src="/test-page-object.js"></script>
7-
<script crossorigin="anonymous" src="/__dist__/webchat-es5.js"></script>
19+
<script type="module">
20+
import React from 'react';
21+
window.React = React;
22+
</script>
23+
<script defer crossorigin="anonymous" src="/__dist__/webchat-es5.js"></script>
24+
<script defer crossorigin="anonymous" src="/__dist__/botframework-webchat-fluent-theme.production.min.js"></script>
25+
<style type="text/css">
26+
.fui-FluentProvider {
27+
height: 100%;
28+
}
29+
</style>
830
</head>
931
<body>
1032
<main id="webchat"></main>
11-
<script>
33+
<script type="module">
34+
import { FluentProvider } from '@fluentui/react-provider';
35+
import { webLightTheme } from '@fluentui/tokens';
36+
import React from 'react';
37+
import { createRoot } from 'react-dom/client';
38+
1239
run(async function () {
40+
const {
41+
WebChat: { FluentThemeProvider, ReactWebChat }
42+
} = window;
43+
1344
const { directLine, store } = testHelpers.createDirectLineEmulator();
1445

15-
WebChat.renderWebChat(
16-
{
17-
directLine,
18-
store
19-
},
20-
document.getElementById('webchat')
46+
const searchParams = new URLSearchParams(location.search);
47+
const variant = searchParams.get('variant');
48+
49+
if (variant) {
50+
window.checkAccessibility = async () => {};
51+
}
52+
53+
const root = createRoot(document.getElementById('webchat'));
54+
const webChatProps = { directLine, store };
55+
56+
root.render(
57+
variant
58+
? React.createElement(
59+
FluentProvider,
60+
{ className: 'fui-FluentProvider', theme: webLightTheme },
61+
React.createElement(FluentThemeProvider, { variant }, React.createElement(ReactWebChat, webChatProps))
62+
)
63+
: React.createElement(ReactWebChat, webChatProps)
2164
);
2265

2366
await pageConditions.uiConnected();
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
<title>Citation show modal link definitions (copilot)</title>
5+
<script>
6+
location = './showModal.linkDefinitions?variant=copilot';
7+
</script>
8+
</head>
9+
<body></body>
10+
</html>
13.3 KB
Loading

0 commit comments

Comments
 (0)