Skip to content

Commit 541402e

Browse files
Merge branch 'main' into remove-activity-listener-composer
2 parents 956ad2b + 8c9cf52 commit 541402e

File tree

48 files changed

+1340
-55
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1340
-55
lines changed

.github/workflows/pull-request-validation.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,9 @@ jobs:
281281
with:
282282
compression-level: 0
283283
name: test-snapshot-diff-html-${{ matrix.shard-index }}
284-
path: ./__tests__/__image_snapshots__/*/__diff_output__/*
284+
path: |
285+
./__tests__/__image_snapshots__/*/__diff_output__/*
286+
./__tests__/html2/**/*.snap-*-diff.png
285287
286288
merge-test-results:
287289
if: always()

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ Notes: web developers are advised to use [`~` (tilde range)](https://github.com/
8484
- Set `styleOptions.speechRecognitionContinuous` to `true` with a Web Speech API provider with continuous mode support
8585
- 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)
8686
- 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)
87+
- (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)
88+
- Added feedback form for like/dislike button when `feedbackActionsPlacement` is `"activity-actions"`, in PR [#5460](https://github.com/microsoft/BotFramework-WebChat/pull/5460), by [@lexi-taylor](https://github.com/lexi-taylor) and [@OEvgeny](https://github.com/OEvgeny)
8789

8890
### Changed
8991

-16.7 KB
Loading

__tests__/html/fluentTheme/transcript.navigation.pageUpDown.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
await pageConditions.scrollStabilized();
7070
await host.snapshot();
7171

72-
// Should page up because the send box is no longer empty
72+
// Should page up because the send box is now empty
7373
await host.sendKeys('BACK_SPACE', 'PAGE_UP');
7474
await pageConditions.scrollStabilized();
7575
await host.snapshot();
Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
<!doctype html>
2+
<html lang="en-US">
3+
<head>
4+
<link href="/assets/index.css" rel="stylesheet" type="text/css" />
5+
<script crossorigin="anonymous" src="https://unpkg.com/@babel/[email protected]/babel.min.js"></script>
6+
<script crossorigin="anonymous" src="https://unpkg.com/[email protected]/umd/react.production.min.js"></script>
7+
<script crossorigin="anonymous" src="https://unpkg.com/[email protected]/umd/react-dom.production.min.js"></script>
8+
<script crossorigin="anonymous" src="/test-harness.js"></script>
9+
<script crossorigin="anonymous" src="/test-page-object.js"></script>
10+
<script crossorigin="anonymous" src="/__dist__/webchat-es5.js"></script>
11+
</head>
12+
<body>
13+
<main id="webchat"></main>
14+
<script type="text/babel">
15+
run(async function () {
16+
const {
17+
React,
18+
ReactDOM: { render },
19+
WebChat: { ReactWebChat }
20+
} = window; // Imports in UMD fashion.
21+
22+
const { directLine, store } = testHelpers.createDirectLineEmulator();
23+
24+
const App = () => (
25+
<React.Fragment>
26+
<ReactWebChat
27+
directLine={directLine}
28+
store={store}
29+
styleOptions={{
30+
feedbackActionsPlacement: 'activity-actions'
31+
}}
32+
/>
33+
</React.Fragment>
34+
);
35+
36+
render(<App />, document.getElementById('webchat'));
37+
38+
await pageConditions.uiConnected();
39+
40+
await directLine.emulateIncomingActivity({
41+
type: 'message',
42+
id: 'a-00000',
43+
timestamp: 0,
44+
text: 'This is a test message to show feedback buttons',
45+
from: {
46+
role: 'bot'
47+
},
48+
locale: 'en-US',
49+
entities: [],
50+
channelData: {
51+
feedbackLoop: {
52+
type: 'default',
53+
disclaimer: 'This is a test disclaimer message'
54+
}
55+
}
56+
});
57+
58+
await pageConditions.numActivitiesShown(1);
59+
60+
pageElements.byTestId('send box text area').focus();
61+
await host.sendShiftTab(3);
62+
63+
await host.sendKeys('ENTER');
64+
await host.sendKeys('ENTER');
65+
66+
await host.snapshot('local');
67+
68+
// Dismiss like button
69+
await host.sendShiftTab(2);
70+
await host.sendKeys('ENTER');
71+
72+
await host.snapshot('local');
73+
74+
// Click like button
75+
await host.sendKeys('ENTER');
76+
77+
await pageConditions.became(
78+
'feedback form is open',
79+
() => document.activeElement === pageElements.byTestId('feedback sendbox'),
80+
1000
81+
);
82+
83+
// Go to cancel button
84+
await host.sendTab(2);
85+
await host.sendKeys('ENTER');
86+
87+
await host.snapshot('local');
88+
89+
// Re-open feedback form
90+
pageElements.byTestId('send box text area').focus();
91+
await host.sendShiftTab(3);
92+
93+
await host.sendKeys('ENTER');
94+
// Send dislike
95+
await host.sendTab(1);
96+
await host.sendKeys('ENTER');
97+
98+
await pageConditions.became(
99+
'feedback form is open',
100+
() => document.activeElement === pageElements.byTestId('feedback sendbox'),
101+
1000
102+
);
103+
104+
await host.sendKeys('Test feedback');
105+
106+
await host.snapshot('local');
107+
108+
const { activity } = await directLine.actPostActivity(async () => {
109+
await host.sendTab(1);
110+
await host.sendKeys('ENTER');
111+
});
112+
113+
expect(activity).toEqual(
114+
expect.objectContaining({
115+
type: 'invoke',
116+
name: 'message/submitAction',
117+
value: {
118+
actionName: 'feedback',
119+
actionValue: {
120+
reaction: 'dislike',
121+
feedback: {
122+
feedbackText: 'Test feedback'
123+
}
124+
}
125+
}
126+
})
127+
);
128+
129+
await host.snapshot('local');
130+
});
131+
</script>
132+
</body>
133+
</html>
26.2 KB
Loading
13.7 KB
Loading
13.4 KB
Loading
22 KB
Loading
13.4 KB
Loading

0 commit comments

Comments
 (0)