Skip to content
Snippets Groups Projects
Commit b61927a5 authored by Detailleur's avatar Detailleur
Browse files

[NRRPLT-8288] take out ROSLIB tests

parent 71e5de2f
No related branches found
No related tags found
No related merge requests found
...@@ -109,32 +109,32 @@ test('register for ROS status information', () => { ...@@ -109,32 +109,32 @@ test('register for ROS status information', () => {
}); });
let progressMessageCallback = jest.fn(); let progressMessageCallback = jest.fn();
// we register twice to check that the original sub is conserved without error // we register twice to check that original sub is destroyed and re-created without error
RunningSimulationService.instance.addRosStatusInfoCallback('test-ros-ws-url', progressMessageCallback); RunningSimulationService.instance.addRosStatusInfoCallback('test-ros-ws-url', progressMessageCallback);
RunningSimulationService.instance.addRosStatusInfoCallback('test-ros-ws-url', progressMessageCallback); RunningSimulationService.instance.addRosStatusInfoCallback('test-ros-ws-url', progressMessageCallback);
expect(RoslibService.instance.getConnection.mock.calls.length).toBe(1); expect(RoslibService.instance.getConnection.mock.calls.length).toBe(2);
expect(mockStatusListener.removeAllListeners.mock.calls.length).toBe(0); expect(mockStatusListener.removeAllListeners.mock.calls.length).toBe(1);
// send status update with task info // send status update with task info
let rosStatusData = { let rosStatusData = {
task: 'test-some-task', progress: {
subtask: 'test-some-subtask' task: 'test-some-task',
subtask: 'test-some-subtask'
}
}; };
statusUpdateCallback({ data: JSON.stringify(rosStatusData) }); statusUpdateCallback({ data: JSON.stringify(rosStatusData) });
expect(progressMessageCallback).toHaveBeenCalledWith({ expect(progressMessageCallback).toHaveBeenCalledWith({
task: rosStatusData.task, main: rosStatusData.progress.task,
subtask: rosStatusData.subtask sub: rosStatusData.progress.subtask
}); });
// send status update indicating we're done // send status update indicating we're done
rosStatusData = { rosStatusData.progress.done = true;
done: true
}
statusUpdateCallback({ data: JSON.stringify(rosStatusData) }); statusUpdateCallback({ data: JSON.stringify(rosStatusData) });
expect(progressMessageCallback).toHaveBeenCalledWith({ expect(progressMessageCallback).toHaveBeenCalledWith({
done: true main: 'Simulation initialized.'
}); });
expect(mockStatusListener.removeAllListeners.mock.calls.length).toBe(0); expect(mockStatusListener.removeAllListeners.mock.calls.length).toBe(2);
}); });
test('can retrieve the state of a simulation', async () => { test('can retrieve the state of a simulation', async () => {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment