Skip to content

Commit

Permalink
Add test #3839
Browse files Browse the repository at this point in the history
  • Loading branch information
BenediktMehl committed Feb 11, 2025
1 parent 5ebb8a8 commit 904bc46
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,21 @@ describe("AddCustomScenarioDialogComponent", () => {

await waitFor(() => expect(screen.findByText("You cannot create an empty Scenario")).toBeTruthy())
})

it("should not apply changes to camera position made after initialization", async () => {
ScenarioHelper.addScenario = jest.fn()
const { fixture } = await render(AddCustomScenarioDialogComponent)
const component = fixture.componentInstance
const threeCameraService = TestBed.inject(ThreeCameraService)
const threeOrbitControlsService = TestBed.inject(ThreeMapControlsService)

const initialScenarioContent = JSON.parse(JSON.stringify(component.scenarioContent))

threeCameraService.camera.position.set(1000, 2000, 3000)
threeOrbitControlsService.controls.target.set(1000, 2000, 3000)

fixture.detectChanges()

expect(component.scenarioContent).toEqual(initialScenarioContent)
})
})

0 comments on commit 904bc46

Please sign in to comment.