Skip to content
Snippets Groups Projects
Commit 0c5433df authored by Sandro Weber's avatar Sandro Weber
Browse files

updated some tests

parent 03bb9090
No related branches found
No related tags found
No related merge requests found
......@@ -58,7 +58,6 @@ export default class SimulationView extends React.Component {
console.info(simInfo);
let experiments = await ExperimentStorageService.instance.getExperiments();
let experimentName = experiments.find(experiment => experiment.id === simInfo.experimentID).configuration.name;
console.info(experimentName);
this.setState({simulationInfo: simInfo, experimentName: experimentName});
}
......
......@@ -202,9 +202,9 @@ test('should be able to stop an experiment', async () => {
await ExperimentExecutionService.instance.stopExperiment(simulation);
expect(RunningSimulationService.instance.updateState).toHaveBeenCalledTimes(2);
expect(RunningSimulationService.instance.updateState).toHaveBeenCalledWith(
expect.any(String), expect.any(String), { state: EXPERIMENT_STATE.INITIALIZED });
expect.any(String), expect.any(String), EXPERIMENT_STATE.INITIALIZED);
expect(RunningSimulationService.instance.updateState).toHaveBeenCalledWith(
expect.any(String), expect.any(String), { state: EXPERIMENT_STATE.STOPPED });
expect.any(String), expect.any(String), EXPERIMENT_STATE.STOPPED);
expect(simulation.stopping).toBe(true);
// stop a STARTED simulation
......@@ -213,7 +213,7 @@ test('should be able to stop an experiment', async () => {
await ExperimentExecutionService.instance.stopExperiment(simulation);
expect(RunningSimulationService.instance.updateState).toHaveBeenCalledTimes(1);
expect(RunningSimulationService.instance.updateState).toHaveBeenCalledWith(
expect.any(String), expect.any(String), { state: EXPERIMENT_STATE.STOPPED });
expect.any(String), expect.any(String), EXPERIMENT_STATE.STOPPED);
// stop a PAUSED simulation
RunningSimulationService.instance.updateState.mockClear();
......@@ -221,7 +221,7 @@ test('should be able to stop an experiment', async () => {
await ExperimentExecutionService.instance.stopExperiment(simulation);
expect(RunningSimulationService.instance.updateState).toHaveBeenCalledTimes(1);
expect(RunningSimulationService.instance.updateState).toHaveBeenCalledWith(
expect.any(String), expect.any(String), { state: EXPERIMENT_STATE.STOPPED });
expect.any(String), expect.any(String), EXPERIMENT_STATE.STOPPED);
// stop a HALTED simulation
RunningSimulationService.instance.updateState.mockClear();
......@@ -229,7 +229,7 @@ test('should be able to stop an experiment', async () => {
await ExperimentExecutionService.instance.stopExperiment(simulation);
expect(RunningSimulationService.instance.updateState).toHaveBeenCalledTimes(1);
expect(RunningSimulationService.instance.updateState).toHaveBeenCalledWith(
expect.any(String), expect.any(String), { state: EXPERIMENT_STATE.STOPPED });
expect.any(String), expect.any(String), EXPERIMENT_STATE.STOPPED);
// stop a simulation in an undefined state, error
RunningSimulationService.instance.updateState.mockClear();
......
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