1
+ <!doctype html>
2
+ < html lang ="en-US ">
3
+
4
+ < head >
5
+ < link href ="/assets/index.css " rel ="stylesheet " type ="text/css " />
6
+ < script crossorigin ="
anonymous "
src ="
https://unpkg.com/@babel/[email protected] /babel.min.js "
> </ script >
7
+ < script crossorigin ="
anonymous "
src ="
https://unpkg.com/[email protected] /umd/react.development.js "
> </ script >
8
+ < script crossorigin ="
anonymous "
src ="
https://unpkg.com/[email protected] /umd/react-dom.development.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
+ </ head >
13
+
14
+ < body >
15
+ < main id ="webchat "> </ main >
16
+ < script type ="text/babel " data-presets ="env,stage-3,react ">
17
+ const {
18
+ React : { useMemo } ,
19
+ WebChat : {
20
+ hooks : { useDirection }
21
+ }
22
+ } = window ;
23
+
24
+ run ( async function ( ) {
25
+ const { directLine, store } = testHelpers . createDirectLineEmulator ( ) ;
26
+
27
+ WebChat . renderWebChat (
28
+ {
29
+ directLine,
30
+ styleOptions : {
31
+ feedbackActionsPlacement : 'activity-actions'
32
+ } ,
33
+ store,
34
+ } ,
35
+ document . getElementById ( 'webchat' )
36
+ ) ;
37
+
38
+ await pageConditions . uiConnected ( ) ;
39
+
40
+ await directLine . emulateIncomingActivity ( {
41
+ from : {
42
+ role : "bot"
43
+ } ,
44
+ id : "a-00002" ,
45
+ timestamp : 0 ,
46
+ type : "message" ,
47
+ text : "This is the message recieving feedback" ,
48
+ entities : [
49
+ {
50
+ '@context' : 'https://schema.org' ,
51
+ '@id' : '' ,
52
+ '@type' : 'Message' ,
53
+ type : 'https://schema.org/Message' ,
54
+ keywords : [ ] ,
55
+ potentialAction : [
56
+ {
57
+ "@type" : "LikeAction" ,
58
+ actionStatus : "PotentialActionStatus" ,
59
+ target : {
60
+ "@type" : "EntryPoint" ,
61
+ urlTemplate : "ms-directline://postback?interaction=like"
62
+ }
63
+ } ,
64
+ {
65
+ "@type" : "DislikeAction" ,
66
+ actionStatus : "PotentialActionStatus" ,
67
+ result : {
68
+ "@type" : "Review" ,
69
+ reviewBody : "I don't like it." ,
70
+ "reviewBody-input" : {
71
+ "@type" : "PropertyValueSpecification" ,
72
+ valueMinLength : 3 ,
73
+ valueName : "reason"
74
+ }
75
+ } ,
76
+ target : {
77
+ "@type" : "EntryPoint" ,
78
+ urlTemplate : "ms-directline://postback?interaction=dislike{&reason}"
79
+ }
80
+ }
81
+ ]
82
+ }
83
+ ]
84
+ } ) ;
85
+
86
+ await pageConditions . numActivitiesShown ( 1 ) ;
87
+
88
+ await host . snapshot ( 'local' ) ;
89
+
90
+ pageElements . sendBoxTextBox ( ) . focus ( ) ;
91
+ await host . sendShiftTab ( 3 ) ;
92
+
93
+ await host . sendKeys ( 'ENTER' ) ;
94
+ await host . snapshot ( 'local' ) ;
95
+ await host . sendKeys ( 'ENTER' ) ;
96
+ await host . snapshot ( 'local' ) ;
97
+
98
+ await directLine . emulateIncomingActivity ( {
99
+ from : {
100
+ role : "bot"
101
+ } ,
102
+ id : "a-00002" ,
103
+ timestamp : 0 ,
104
+ type : "message" ,
105
+ text : "This is the message with dismissed feedback" ,
106
+ entities : [
107
+ {
108
+ '@context' : 'https://schema.org' ,
109
+ '@id' : '' ,
110
+ '@type' : 'Message' ,
111
+ type : 'https://schema.org/Message' ,
112
+ keywords : [ ] ,
113
+ potentialAction : [
114
+ {
115
+ "@type" : "LikeAction" ,
116
+ actionStatus : "PotentialActionStatus" ,
117
+ target : {
118
+ "@type" : "EntryPoint" ,
119
+ urlTemplate : "ms-directline://postback?interaction=like"
120
+ }
121
+ } ,
122
+ {
123
+ "@type" : "DislikeAction" ,
124
+ actionStatus : "PotentialActionStatus" ,
125
+ result : {
126
+ "@type" : "Review" ,
127
+ reviewBody : "I don't like it." ,
128
+ "reviewBody-input" : {
129
+ "@type" : "PropertyValueSpecification" ,
130
+ valueMinLength : 3 ,
131
+ valueName : "reason"
132
+ }
133
+ } ,
134
+ target : {
135
+ "@type" : "EntryPoint" ,
136
+ urlTemplate : "ms-directline://postback?interaction=dislike{&reason}"
137
+ }
138
+ }
139
+ ]
140
+ }
141
+ ]
142
+ } ) ;
143
+
144
+ await host . snapshot ( 'local' ) ;
145
+ } , { ignoreErrors : true } ) ;
146
+ </ script >
147
+ </ body >
148
+
149
+ </ html >
0 commit comments