Fix reporting messages tags count
Report interaction accepts only type object for parameter details Change-Id: Id095b12baf34b824445bcf4ea16cdfeeeac93e6b
This commit is contained in:
@@ -367,8 +367,7 @@
|
||||
acc[val] = (acc[val] || 0) + 1;
|
||||
return acc;
|
||||
}, {all: messages.length});
|
||||
this.$.reporting.reportInteraction('messages-count',
|
||||
JSON.stringify(tagsCounted));
|
||||
this.$.reporting.reportInteraction('messages-count', tagsCounted);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -553,6 +553,23 @@ limitations under the License.
|
||||
assert.isFalse(element._hasAutomatedMessages(messages));
|
||||
});
|
||||
|
||||
test('initially show only 20 messages', () => {
|
||||
sandbox.stub(element.$.reporting, 'reportInteraction',
|
||||
(eventName, details) => {
|
||||
assert.equal(typeof(eventName), 'string');
|
||||
if (details) {
|
||||
assert.equal(typeof(details), 'object');
|
||||
}
|
||||
});
|
||||
const messages = Array.from(Array(23).keys())
|
||||
.map(() => {
|
||||
return {};
|
||||
});
|
||||
element._processedMessagesChanged(messages);
|
||||
|
||||
assert.equal(element._visibleMessages.length, 20);
|
||||
});
|
||||
|
||||
test('_computeLabelExtremes', () => {
|
||||
const computeSpy = sandbox.spy(element, '_computeLabelExtremes');
|
||||
|
||||
|
Reference in New Issue
Block a user