From ae434f9005e5b0af33af6c6cfde795f02eaf9155 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B6ckelmann?= Date: Thu, 9 May 2024 18:55:51 +0200 Subject: [PATCH] Remove unnessecary ScriptAccountTest.spec.ts --- .../scriptAccounts/ScriptAccountTest.spec.ts | 71 ------------------- 1 file changed, 71 deletions(-) delete mode 100644 e2e/game-model/scriptAccounts/ScriptAccountTest.spec.ts diff --git a/e2e/game-model/scriptAccounts/ScriptAccountTest.spec.ts b/e2e/game-model/scriptAccounts/ScriptAccountTest.spec.ts deleted file mode 100644 index 27aaed2..0000000 --- a/e2e/game-model/scriptAccounts/ScriptAccountTest.spec.ts +++ /dev/null @@ -1,71 +0,0 @@ -import { BrowserContext, ElectronApplication, Page, _electron as electron } from 'playwright'; -import { test, expect } from '@playwright/test'; -import * as PATH from 'path'; -import {GameModel} from "../../../src/app/project/game-model/GameModel"; -import {Gamesystem} from "../../src/app/project/game-model/gamesystems/Gamesystem"; -import {ScriptAccount} from "../../../src/app/project/game-model/scriptAccounts/ScriptAccount"; -import {ModelComponentType} from "../../../src/app/project/game-model/ModelComponentType"; - -test.describe('Test ScriptAccounts', () => { - - test("Test ScriptAccount Creation", async () => { - const scriptAccunt = new ScriptAccount("ScriptAccount", "Description"); - - expect(scriptAccunt.componentName).toEqual("ScriptAccount"); - expect(scriptAccunt.componentDescription).toEqual("Description"); - expect(scriptAccunt.type).toEqual(ModelComponentType.SCRIPTACCOUNT); - expect(scriptAccunt.minValue).toEqual(0); - expect(scriptAccunt.maxValue).toEqual(100); - }) - - test("Test Adding ScriptAccounts", async () => { - const gameModel: GameModel = new GameModel("GameModel"); - - let scriptAccount =gameModel.createScriptAccount("ScriptAccount"); - expect(scriptAccount).toBeDefined(); - expect(gameModel.scriptAccounts.length).toEqual(1); - expect(gameModel.scriptAccounts.includes(scriptAccount)).toBeTruthy(); - - //Test adding scriptAccount with already existing name - const scriptAccount2 = gameModel.createScriptAccount("ScriptAccount") - expect(scriptAccount2).toBeUndefined(); - expect(gameModel.scriptAccounts.length).toEqual(1); - - //Test for adding invalid names as scriptaccount names (null/undefined/empty) - let result = gameModel.createScriptAccount(null); - expect(result).toBeUndefined(); - expect(gameModel.scriptAccounts.length).toEqual(1); - result = gameModel.createScriptAccount(undefined); - expect(result).toBeUndefined(); - expect(gameModel.scriptAccounts.length).toEqual(1); - result = gameModel.createScriptAccount(""); - expect(result).toBeUndefined(); - expect(gameModel.scriptAccounts.length).toEqual(1); - }) - - test("test Removing ScriptAccounts", async () => { - const gameModel: GameModel = new GameModel("GameModel"); - let scriptAccount = new ScriptAccount("test", "") - - gameModel.removeScriptAccount(scriptAccount); - expect(gameModel.scriptAccounts.length).toEqual(0); - - scriptAccount = gameModel.createScriptAccount("ScriptAccount"); - gameModel.removeScriptAccount(scriptAccount); - expect(gameModel.scriptAccounts.length).toEqual(0); - - gameModel.removeScriptAccount(undefined); - expect(gameModel.scriptAccounts.length).toEqual(0); - - gameModel.removeScriptAccount(null); - expect(gameModel.scriptAccounts.length).toEqual(0); - - scriptAccount = gameModel.createScriptAccount(scriptAccount); - let scriptAccount2 = gameModel.createScriptAccount("ScriptAccount 2"); - - gameModel.removeScriptAccount(scriptAccount); - expect(gameModel.scriptAccounts.length).toEqual(1); - expect(gameModel.scriptAccounts.includes(scriptAccount2)).toBeTruthy(); - }) - -});