BugFixes
This commit is contained in:
@@ -51,6 +51,34 @@ describe('RobotController (ToDo_6)', () => {
|
||||
expect(robot.sendCommand).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
test('applyCommand: M92 setzt Motorwerte absolut und sendet G92', () => {
|
||||
const robot = createDummyRobot();
|
||||
robot.createMotorPosition = jest.fn();
|
||||
|
||||
RobotController.applyCommand(robot, { command: 'M92', params: { X: 5, Y: 0.5, A: 0.3 } });
|
||||
|
||||
expect(robot.createMotorPosition).toHaveBeenCalledTimes(1);
|
||||
expect(robot.xMotor).toBe(5);
|
||||
expect(robot.alpha).toBe(0.5);
|
||||
expect(robot.a).toBe(0.3);
|
||||
expect(robot.calculatePositionFromMotorAngles).toHaveBeenCalled();
|
||||
expect(robot.sendCommand).toHaveBeenCalledWith('G92');
|
||||
});
|
||||
|
||||
test('applyCommand: G92 verhält sich identisch zu M92 (Bug 3)', () => {
|
||||
const robot = createDummyRobot();
|
||||
robot.createMotorPosition = jest.fn();
|
||||
|
||||
RobotController.applyCommand(robot, { command: 'G92', params: { X: 5, Y: 0.5, A: 0.3 } });
|
||||
|
||||
expect(robot.createMotorPosition).toHaveBeenCalledTimes(1);
|
||||
expect(robot.xMotor).toBe(5);
|
||||
expect(robot.alpha).toBe(0.5);
|
||||
expect(robot.a).toBe(0.3);
|
||||
expect(robot.calculatePositionFromMotorAngles).toHaveBeenCalled();
|
||||
expect(robot.sendCommand).toHaveBeenCalledWith('G92');
|
||||
});
|
||||
|
||||
test('applyCommand: ungültiger Befehl wird ignoriert', () => {
|
||||
const robot = createDummyRobot();
|
||||
RobotController.applyCommand(robot, null);
|
||||
|
||||
Reference in New Issue
Block a user