wingbot 3.67.18 → 3.67.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/Tester.js +1 -1
- package/src/testTools/AnyResponseAssert.js +29 -0
package/package.json
CHANGED
package/src/Tester.js
CHANGED
|
@@ -19,7 +19,7 @@ const Router = require('./Router'); // eslint-disable-line no-unused-vars
|
|
|
19
19
|
const ReducerWrapper = require('./ReducerWrapper'); // eslint-disable-line no-unused-vars
|
|
20
20
|
const { FEATURE_TEXT } = require('./features');
|
|
21
21
|
|
|
22
|
-
/** @typedef {import('./Processor').ProcessorOptions} ProcessorOptions */
|
|
22
|
+
/** @typedef {import('./Processor').ProcessorOptions<Router>} ProcessorOptions */
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
25
|
* Utility for testing requests
|
|
@@ -116,6 +116,35 @@ class AnyResponseAssert {
|
|
|
116
116
|
return this;
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
+
/**
|
|
120
|
+
* Checks for missing quick response text
|
|
121
|
+
*
|
|
122
|
+
* @param {string} search
|
|
123
|
+
* @returns {this}
|
|
124
|
+
*
|
|
125
|
+
* @memberOf ResponseAssert
|
|
126
|
+
*/
|
|
127
|
+
quickReplyTextNotContains (search) {
|
|
128
|
+
const ok = this.responses
|
|
129
|
+
.every((res) => !asserts.quickReplyText(res, search, false));
|
|
130
|
+
|
|
131
|
+
if (!ok) {
|
|
132
|
+
const actual = this.responses
|
|
133
|
+
.map((res) => asserts.getQuickReplies(res))
|
|
134
|
+
.filter((replies) => !!replies)
|
|
135
|
+
.reduce((a, replies) => {
|
|
136
|
+
for (const { title } of replies) {
|
|
137
|
+
if (title) {
|
|
138
|
+
a.push(title);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
return a;
|
|
142
|
+
}, []);
|
|
143
|
+
assert.fail(m('Quick reply should not be found', search, actual));
|
|
144
|
+
}
|
|
145
|
+
return this;
|
|
146
|
+
}
|
|
147
|
+
|
|
119
148
|
/**
|
|
120
149
|
* Checks template type
|
|
121
150
|
*
|