Skip to content

Commit e06cf05

Browse files
committed
revert changes and new snapshots
1 parent d0661ef commit e06cf05

19 files changed

Lines changed: 140 additions & 189 deletions

__tests__/html2/activity/feedback.form.activity.html

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,6 @@
6969
await host.sendShiftTab(2);
7070
await host.sendKeys('ENTER');
7171

72-
await host.snapshot('local');
73-
7472
// Click like button
7573
await host.sendKeys('ENTER');
7674

-342 Bytes
Loading
8.63 KB
Loading
-8.71 KB
Loading
-13.4 KB
Binary file not shown.

__tests__/html2/fluentTheme/defaultFeedback.activity.dark.html

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -98,18 +98,8 @@
9898

9999
pageElements.byTestId('send box text area').focus();
100100
await host.sendShiftTab(2);
101-
102-
await host.sendKeys('ENTER');
103-
await host.sendKeys('ENTER');
104-
105-
await host.snapshot('local');
106-
107-
// Dismiss like button
108-
await host.sendShiftTab(2);
109101
await host.sendKeys('ENTER');
110102

111-
await host.snapshot('local');
112-
113103
// Click like button
114104
await host.sendKeys('ENTER');
115105

@@ -119,50 +109,8 @@
119109
1000
120110
);
121111

122-
// Go to cancel button
123-
await host.sendTab(2);
124-
await host.sendKeys('ENTER');
125-
126-
await host.snapshot('local');
127-
128-
pageElements.byTestId('send box text area').focus();
129-
await host.sendShiftTab(2);
130-
131-
await host.sendKeys('ENTER');
132-
// Send dislike
133-
await host.sendTab(1);
134-
await host.sendKeys('ENTER');
135-
136-
await pageConditions.became(
137-
'feedback form is open',
138-
() => document.activeElement === pageElements.byTestId('feedback sendbox'),
139-
1000
140-
);
141-
142-
await host.sendKeys('Test feedback');
143-
144112
await host.snapshot('local');
145113

146-
const { activity } = await directLine.actPostActivity(async () => {
147-
await host.sendTab(1);
148-
await host.sendKeys('ENTER');
149-
});
150-
151-
expect(activity).toEqual(
152-
expect.objectContaining({
153-
type: 'invoke',
154-
name: 'message/submitAction',
155-
value: {
156-
actionName: 'feedback',
157-
actionValue: {
158-
reaction: 'dislike',
159-
feedback: {
160-
feedbackText: 'Test feedback'
161-
}
162-
}
163-
}
164-
})
165-
);
166114
});
167115
</script>
168116
</body>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Lines changed: 110 additions & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -1,137 +1,132 @@
11
<!doctype html>
22
<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/standalone@7.8.7/babel.min.js"></script>
6-
<script crossorigin="anonymous" src="https://unpkg.com/react@16.8.6/umd/react.production.min.js"></script>
7-
<script crossorigin="anonymous" src="https://unpkg.com/react-dom@16.8.6/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-
<script crossorigin="anonymous" src="/__dist__/botframework-webchat-fluent-theme.production.min.js"></script>
12-
</head>
13-
14-
<body>
15-
<main id="webchat"></main>
16-
<script type="text/babel">
17-
run(async function () {
18-
const {
19-
React,
20-
ReactDOM: { render },
21-
WebChat: { FluentThemeProvider, ReactWebChat }
22-
} = window; // Imports in UMD fashion.
23-
24-
const { directLine, store } = testHelpers.createDirectLineEmulator();
25-
26-
const App = () => <ReactWebChat directLine={directLine} store={store} />;
27-
28-
render(
29-
<FluentThemeProvider>
30-
<App />
31-
</FluentThemeProvider>,
32-
document.getElementById('webchat')
33-
);
34-
35-
await pageConditions.uiConnected();
36-
37-
await directLine.emulateIncomingActivity({
38-
type: 'message',
39-
id: 'a-00000',
40-
timestamp: 0,
41-
text: 'This is a test message to show feedback buttons',
42-
from: {
43-
role: 'bot'
44-
},
45-
locale: 'en-US',
46-
entities: [],
47-
channelData: {
48-
feedbackLoop: {
49-
type: 'default',
50-
disclaimer: 'This is a test disclaimer message'
51-
}
3+
4+
<head>
5+
<link href="/assets/index.css" rel="stylesheet" type="text/css" />
6+
<script crossorigin="anonymous" src="https://unpkg.com/@babel/standalone@7.8.7/babel.min.js"></script>
7+
<script crossorigin="anonymous" src="https://unpkg.com/react@16.8.6/umd/react.production.min.js"></script>
8+
<script crossorigin="anonymous" src="https://unpkg.com/react-dom@16.8.6/umd/react-dom.production.min.js"></script>
9+
<script crossorigin="anonymous" src="/test-harness.js"></script>
10+
<script crossorigin="anonymous" src="/test-page-object.js"></script>
11+
<script crossorigin="anonymous" src="/__dist__/webchat-es5.js"></script>
12+
<script crossorigin="anonymous" src="/__dist__/botframework-webchat-fluent-theme.production.min.js"></script>
13+
</head>
14+
15+
<body>
16+
<main id="webchat"></main>
17+
<script type="text/babel">
18+
run(async function () {
19+
const {
20+
React,
21+
ReactDOM: { render },
22+
WebChat: { FluentThemeProvider, ReactWebChat }
23+
} = window; // Imports in UMD fashion.
24+
25+
const { directLine, store } = testHelpers.createDirectLineEmulator();
26+
27+
const App = () => <ReactWebChat directLine={directLine} store={store} />;
28+
29+
render(
30+
<FluentThemeProvider>
31+
<App />
32+
</FluentThemeProvider>,
33+
document.getElementById('webchat')
34+
);
35+
36+
await pageConditions.uiConnected();
37+
38+
await directLine.emulateIncomingActivity({
39+
type: 'message',
40+
id: 'a-00000',
41+
timestamp: 0,
42+
text: 'This is a test message to show feedback buttons',
43+
from: {
44+
role: 'bot'
45+
},
46+
locale: 'en-US',
47+
entities: [],
48+
channelData: {
49+
feedbackLoop: {
50+
type: 'default',
51+
disclaimer: 'This is a test disclaimer message'
5252
}
53-
});
53+
}
54+
});
5455

55-
await pageConditions.numActivitiesShown(1);
56+
await pageConditions.numActivitiesShown(1);
5657

57-
pageElements.byTestId('send box text area').focus();
58-
await host.sendShiftTab(2);
58+
pageElements.byTestId('send box text area').focus();
59+
await host.sendShiftTab(2);
5960

60-
await host.sendKeys('ENTER');
61-
await host.sendKeys('ENTER');
61+
await host.sendKeys('ENTER');
62+
await host.sendKeys('ENTER');
6263

63-
await host.snapshot('local');
64+
await host.snapshot('local');
6465

65-
// Dismiss like button
66-
await host.sendShiftTab(2);
67-
await host.sendKeys('ENTER');
66+
// Dismiss like button
67+
await host.sendShiftTab(2);
68+
await host.sendKeys('ENTER');
6869

69-
// Tooltip is only present sometimes
70-
const toolTip = pageElements.byTestId('thumb button tooltip');
71-
if (toolTip) {
72-
// Dismiss tooltip
73-
await host.sendKeys('ESCAPE');
74-
}
70+
// Click like button
71+
await host.sendKeys('ENTER');
7572

76-
await host.snapshot('local');
73+
await pageConditions.became(
74+
'feedback form is open',
75+
() => document.activeElement === pageElements.byTestId('feedback sendbox'),
76+
1000
77+
);
7778

78-
// Click like button
79-
await host.sendKeys('ENTER');
79+
// Go to cancel button
80+
await host.sendTab(2);
81+
await host.sendKeys('ENTER');
8082

81-
await pageConditions.became(
82-
'feedback form is open',
83-
() => document.activeElement === pageElements.byTestId('feedback sendbox'),
84-
1000
85-
);
83+
await host.snapshot('local');
8684

87-
// Go to cancel button
88-
await host.sendTab(2);
89-
await host.sendKeys('ENTER');
85+
pageElements.byTestId('send box text area').focus();
86+
await host.sendShiftTab(2);
9087

91-
await host.snapshot('local');
88+
await host.sendKeys('ENTER');
89+
// Send dislike
90+
await host.sendTab(1);
91+
await host.sendKeys('ENTER');
9292

93-
pageElements.byTestId('send box text area').focus();
94-
await host.sendShiftTab(2);
93+
await pageConditions.became(
94+
'feedback form is open',
95+
() => document.activeElement === pageElements.byTestId('feedback sendbox'),
96+
1000
97+
);
9598

96-
await host.sendKeys('ENTER');
97-
// Send dislike
99+
await host.sendKeys('Test feedback');
100+
101+
await host.snapshot('local');
102+
103+
const { activity } = await directLine.actPostActivity(async () => {
98104
await host.sendTab(1);
99105
await host.sendKeys('ENTER');
106+
});
100107

101-
await pageConditions.became(
102-
'feedback form is open',
103-
() => document.activeElement === pageElements.byTestId('feedback sendbox'),
104-
1000
105-
);
106-
107-
await host.sendKeys('Test feedback');
108-
109-
await host.snapshot('local');
110-
111-
const { activity } = await directLine.actPostActivity(async () => {
112-
await host.sendTab(1);
113-
await host.sendKeys('ENTER');
114-
});
115-
116-
expect(activity).toEqual(
117-
expect.objectContaining({
118-
type: 'invoke',
119-
name: 'message/submitAction',
120-
value: {
121-
actionName: 'feedback',
122-
actionValue: {
123-
reaction: 'dislike',
124-
feedback: {
125-
feedbackText: 'Test feedback'
126-
}
108+
expect(activity).toEqual(
109+
expect.objectContaining({
110+
type: 'invoke',
111+
name: 'message/submitAction',
112+
value: {
113+
actionName: 'feedback',
114+
actionValue: {
115+
reaction: 'dislike',
116+
feedback: {
117+
feedbackText: 'Test feedback'
127118
}
128119
}
129-
})
130-
);
120+
}
121+
})
122+
);
131123

132-
// Feedback button state should persist
133-
await host.snapshot('local');
134-
});
135-
</script>
136-
</body>
137-
</html>
124+
await expect(pageElements.byTestId('feedback sendbox')).toBeFalsy();
125+
126+
// Feedback button state should persist
127+
await host.snapshot('local');
128+
});
129+
</script>
130+
</body>
131+
132+
</html>

0 commit comments

Comments
 (0)