Remove SimpleTransitions
All checks were successful
E2E Testing / test (push) Successful in 1m24s

This commit is contained in:
Sebastian Böckelmann 2024-02-06 19:58:18 +01:00
parent 40fb7c6ab7
commit dda3aa4bed

View File

@ -139,6 +139,34 @@ test.describe('Test SimpleGamesystem', () => {
}) })
test("Remove SimpleTransition", async () => { 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();
}) })
}); });