diff --git a/polygerrit-ui/app/elements/change/gr-messages-list/gr-messages-list.js b/polygerrit-ui/app/elements/change/gr-messages-list/gr-messages-list.js index cd759d315a..20680b5371 100644 --- a/polygerrit-ui/app/elements/change/gr-messages-list/gr-messages-list.js +++ b/polygerrit-ui/app/elements/change/gr-messages-list/gr-messages-list.js @@ -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); } } diff --git a/polygerrit-ui/app/elements/change/gr-messages-list/gr-messages-list_test.html b/polygerrit-ui/app/elements/change/gr-messages-list/gr-messages-list_test.html index b0747f4a90..9c3f53bac2 100644 --- a/polygerrit-ui/app/elements/change/gr-messages-list/gr-messages-list_test.html +++ b/polygerrit-ui/app/elements/change/gr-messages-list/gr-messages-list_test.html @@ -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');