mirror of
https://github.com/nasa/openmct.git
synced 2025-06-18 15:18:12 +00:00
[Table] #742 Fixed digest-related bug in RTTelemetryController
Fixed failing test
This commit is contained in:
@ -89,9 +89,9 @@ define(
|
|||||||
datum = self.handle.getDatum(telemetryObject);
|
datum = self.handle.getDatum(telemetryObject);
|
||||||
if (datum) {
|
if (datum) {
|
||||||
row = self.table.getRowValues(telemetryObject, datum);
|
row = self.table.getRowValues(telemetryObject, datum);
|
||||||
self.$scope.rows = self.$scope.rows || [];
|
|
||||||
if (!self.$scope.rows){
|
if (!self.$scope.rows){
|
||||||
self.$scope.rows = [row];
|
self.$scope.rows = [row];
|
||||||
|
self.$scope.$digest();
|
||||||
} else {
|
} else {
|
||||||
self.$scope.rows.push(row);
|
self.$scope.rows.push(row);
|
||||||
self.$scope.$broadcast('add:row',
|
self.$scope.$broadcast('add:row',
|
||||||
|
@ -56,6 +56,7 @@ define(
|
|||||||
'$on',
|
'$on',
|
||||||
'$watch',
|
'$watch',
|
||||||
'$watchCollection',
|
'$watchCollection',
|
||||||
|
'$digest',
|
||||||
'$broadcast'
|
'$broadcast'
|
||||||
]);
|
]);
|
||||||
mockScope.$on.andCallFake(function (expression, callback){
|
mockScope.$on.andCallFake(function (expression, callback){
|
||||||
@ -131,6 +132,7 @@ define(
|
|||||||
|
|
||||||
it('updates table with new streaming telemetry', function () {
|
it('updates table with new streaming telemetry', function () {
|
||||||
controller.subscribe();
|
controller.subscribe();
|
||||||
|
mockScope.rows = [];
|
||||||
mockTelemetryHandler.handle.mostRecentCall.args[1]();
|
mockTelemetryHandler.handle.mostRecentCall.args[1]();
|
||||||
expect(mockScope.$broadcast).toHaveBeenCalledWith('add:row', 0);
|
expect(mockScope.$broadcast).toHaveBeenCalledWith('add:row', 0);
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user