Skip to content

Commit d599435

Browse files
authored
Merge branch 'main' into iframe-postmessage-handle-focus
2 parents fa286d4 + 44688ae commit d599435

28 files changed

+398
-440
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ Notes: web developers are advised to use [`~` (tilde range)](https://github.com/
8787
- Added support of [contentless activity in livestream](https://github.com/microsoft/BotFramework-WebChat/blob/main/docs/LIVESTREAMING.md#scenario-3-interim-activities-with-no-content), in PR [#5430](https://github.com/microsoft/BotFramework-WebChat/pull/5430), by [@compulim](https://github.com/compulim)
8888
- Added sliding dots typing indicator in Fluent theme, in PR [#5447](https://github.com/microsoft/BotFramework-WebChat/pull/5447) and PR [#5448](https://github.com/microsoft/BotFramework-WebChat/pull/5448), by [@compulim](https://github.com/compulim)
8989
- (Experimental) Add an ability to pass `completion` prop into Fluent send box and expose the component, in PR [#5466](https://github.com/microsoft/BotFramework-WebChat/pull/5466), by [@OEvgeny](https://github.com/OEvgeny)
90-
- Added feedback form for like/dislike button when `feedbackActionsPlacement` is `"activity-actions"`, in PR [#5460](https://github.com/microsoft/BotFramework-WebChat/pull/5460), PR [#5469](https://github.com/microsoft/BotFramework-WebChat/pull/5469), and PR [5470](https://github.com/microsoft/BotFramework-WebChat/pull/5470) by [@lexi-taylor](https://github.com/lexi-taylor) and [@OEvgeny](https://github.com/OEvgeny)
90+
- Added feedback form for like/dislike button when `feedbackActionsPlacement` is `"activity-actions"`, in PR [#5460](https://github.com/microsoft/BotFramework-WebChat/pull/5460), PR [#5469](https://github.com/microsoft/BotFramework-WebChat/pull/5469), PR [5470](https://github.com/microsoft/BotFramework-WebChat/pull/5470) and PR [#5501](https://github.com/microsoft/BotFramework-WebChat/pull/5501) by [@lexi-taylor](https://github.com/lexi-taylor) and [@OEvgeny](https://github.com/OEvgeny)
9191
- <kbd>ESCAPE</kbd> key should reset the feedback form, in PR [#5480](https://github.com/microsoft/BotFramework-WebChat/pull/5480), by [@compulim](https://github.com/compulim), in PR [#5493](https://github.com/microsoft/BotFramework-WebChat/pull/5493) by [@lexi-taylor](https://github.com/lexi-taylor)
9292
- Added multi-dimensional grouping, `styleOptions.groupActivitiesBy`, and `useGroupActivitiesByName` hook, in PR [#5471](https://github.com/microsoft/BotFramework-WebChat/pull/5471), by [@compulim](https://github.com/compulim)
9393
- Existing behavior will be kept and activities will be grouped by `sender` followed by `status`
-55 Bytes
Loading
-230 Bytes
Loading
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!doctype html>
2+
<html lang="en-US">
3+
<head>
4+
<title>Feedback Form (fluent): Scrollbar behavior when input is long</title>
5+
<script>
6+
location.href = './feedback.form.scroll?theme=fluent';
7+
</script>
8+
</head>
9+
<body></body>
10+
</html>
43.3 KB
Loading
43.2 KB
Loading
13.3 KB
Loading
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
<!doctype html>
2+
<html lang="en-US">
3+
<head>
4+
<title>Feedback Form: Scrollbar behavior when input is long</title>
5+
<link href="/assets/index.css" rel="stylesheet" type="text/css" />
6+
<script type="importmap">
7+
{
8+
"imports": {
9+
"react": "https://esm.sh/react@18.3.1",
10+
"react-dom": "https://esm.sh/react-dom@18.3.1",
11+
"react-dom/": "https://esm.sh/react-dom@18.3.1/",
12+
"@fluentui/react-components": "https://esm.sh/@fluentui/react-components?deps=react@18.3.1&exports=FluentProvider,createDarkTheme,webLightTheme"
13+
}
14+
}
15+
</script>
16+
<script crossorigin="anonymous" src="/test-harness.js"></script>
17+
<script crossorigin="anonymous" src="/test-page-object.js"></script>
18+
<script type="module">
19+
import React from 'react';
20+
import ReactDOM from 'react-dom';
21+
window.React = React;
22+
window.ReactDOM = ReactDOM;
23+
</script>
24+
<script defer crossorigin="anonymous" src="/__dist__/webchat-es5.js"></script>
25+
<script defer crossorigin="anonymous" src="/__dist__/botframework-webchat-fluent-theme.production.min.js"></script>
26+
</head>
27+
28+
<body>
29+
<main id="webchat"></main>
30+
<script type="module">
31+
run(async function () {
32+
const {
33+
WebChat: { testIds }
34+
} = window; // Imports in UMD fashion.
35+
36+
const { directLine, store } = testHelpers.createDirectLineEmulator();
37+
38+
const { isFluentTheme } = renderWebChat(
39+
{
40+
directLine,
41+
store,
42+
styleOptions: { feedbackActionsPlacement: 'activity-actions' }
43+
},
44+
document.getElementById('webchat')
45+
);
46+
47+
await pageConditions.uiConnected();
48+
pageElements.byTestId(testIds.sendBoxTextBox).focus();
49+
50+
// GIVEN: An activity with feedback form.
51+
await directLine.emulateIncomingActivity({
52+
type: 'message',
53+
id: 'a-00000',
54+
timestamp: 0,
55+
text: 'This is a test message to show feedback buttons',
56+
from: {
57+
role: 'bot'
58+
},
59+
locale: 'en-US',
60+
entities: [],
61+
channelData: {
62+
feedbackLoop: {
63+
type: 'default',
64+
disclaimer: 'This is a test disclaimer message'
65+
}
66+
}
67+
});
68+
69+
await pageConditions.numActivitiesShown(1);
70+
71+
// WHEN: Focus on the like button.
72+
if (isFluentTheme) {
73+
await host.sendShiftTab(1);
74+
await host.sendKeys('ARROW_UP');
75+
await host.sendKeys('ENTER', 'SPACE');
76+
} else {
77+
await host.sendShiftTab(3);
78+
await host.sendKeys('ENTER', 'SPACE');
79+
}
80+
81+
// THEN: The feedback form should be expanded.
82+
await pageConditions.became(
83+
'feedback form is open',
84+
() => document.activeElement === pageElements.byTestId(testIds.feedbackSendBox),
85+
1000
86+
);
87+
88+
// WHEN: The form is filled with more than 10 lines of text.
89+
await host.sendKeys('Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris '.repeat(12));
90+
91+
// THEN: The feedback form should have scroll visible
92+
await host.snapshot('local');
93+
94+
// WHEN: The text area is not focused.
95+
await host.sendTab(1);
96+
97+
// THEN: The feedback form should have scrollbar hidden.
98+
await host.snapshot('local');
99+
100+
// WHEN: A feedback form with scroll is being submitted.
101+
await directLine.actPostActivity(async () => {
102+
await host.sendKeys('ENTER');
103+
});
104+
105+
106+
// THEN: Feedback form should be collapsed.
107+
await expect(pageElements.byTestId(testIds.feedbackSendBox)).toBeFalsy();
108+
109+
// THEN: All feedback buttons should be grayed out.
110+
await expect(
111+
Array.from(pageElements.allByTestId(testIds.feedbackButton)).every(
112+
buttonElement => buttonElement.getAttribute('aria-disabled') === 'true'
113+
)
114+
).toBe(true);
115+
116+
// THEN: Should match snapshot.
117+
await host.snapshot('local');
118+
});
119+
</script>
120+
</body>
121+
</html>
44.3 KB
Loading
44.4 KB
Loading

0 commit comments

Comments
 (0)