diff --git a/e2e/game-model/gamesystems/SimpleGamesystem.spec.ts b/e2e/game-model/gamesystems/SimpleGamesystem.spec.ts index e916883..4c61efd 100644 --- a/e2e/game-model/gamesystems/SimpleGamesystem.spec.ts +++ b/e2e/game-model/gamesystems/SimpleGamesystem.spec.ts @@ -139,6 +139,34 @@ test.describe('Test SimpleGamesystem', () => { }) test("Remove SimpleTransition", async () => { + const gamesystem = new SimpleGamesystem("Gamesystem"); + const A = gamesystem.createState("A"); + const B = gamesystem.createState("B"); + let AB = gamesystem.createTransition(A, B); + + let result = gamesystem.removeTransition(AB); + expect(result).toBeTruthy(); + expect(gamesystem.transitions.includes(AB)).toBeFalsy(); + + AB = gamesystem.createTransition(A, B); + const C = gamesystem.createState("C"); + const D = gamesystem.createState("D"); + let CD = gamesystem.createTransition(C, D); + + result = gamesystem.removeTransition(AB); + expect(result).toBeTruthy(); + expect(gamesystem.transitions.includes(AB)).toBeFalsy(); + expect(gamesystem.transitions.includes(CD)).toBeTruthy(); + + let BA = gamesystem.createTransition(B, A); + AB = gamesystem.createTransition(A, B); + result = gamesystem.removeTransition(AB); + expect(result).toBeTruthy(); + expect(gamesystem.transitions.includes(AB)).toBeFalsy(); + expect(gamesystem.transitions.includes(BA)).toBeTruthy(); + + result = gamesystem.removeTransition(AB); + expect(result).toBeFalsy(); }) });