diff --git a/platform/features/table/src/controllers/TelemetryTableController.js b/platform/features/table/src/controllers/TelemetryTableController.js index a46cdf6f9c..4018d61dd9 100644 --- a/platform/features/table/src/controllers/TelemetryTableController.js +++ b/platform/features/table/src/controllers/TelemetryTableController.js @@ -170,6 +170,9 @@ define( * @param rows */ TelemetryTableController.prototype.addRowsToTable = function (rows) { + rows.forEach(function (row) { + this.$scope.rows.push(row); + }, this); this.$scope.$broadcast('add:rows', rows); }; diff --git a/platform/features/table/test/controllers/TelemetryTableControllerSpec.js b/platform/features/table/test/controllers/TelemetryTableControllerSpec.js index 68bee66734..b745081974 100644 --- a/platform/features/table/test/controllers/TelemetryTableControllerSpec.js +++ b/platform/features/table/test/controllers/TelemetryTableControllerSpec.js @@ -436,5 +436,28 @@ define( expect(mockScope.$broadcast).toHaveBeenCalledWith("remove:rows", discardedRows); }); + describe('when telemetry is added', function () { + var testRows; + var expectedRows; + + beforeEach(function () { + testRows = [{ a: 0 }, { a: 1 }, { a: 2 }]; + mockScope.rows = [{ a: -1 }]; + expectedRows = mockScope.rows.concat(testRows); + + spyOn(controller.telemetry, "on").andCallThrough(); + controller.registerChangeListeners(); + + controller.telemetry.on.calls.forEach(function (call) { + if (call.args[0] === 'added') { + call.args[1](testRows); + } + }); + }); + + it("adds it to rows in scope", function () { + expect(mockScope.rows).toEqual(expectedRows); + }); + }); }); });