ConceptCreator/e2e/game-model/gamesystems/productGamesystems/EqualInnerStates.spec.ts
Sebastian Böckelmann f38626683e
All checks were successful
E2E Testing / test (push) Successful in 1m33s
Refactor Gamesystems
2024-02-17 15:38:51 +01:00

38 lines
2.0 KiB
TypeScript

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/game-model/GameModel";
import {Gamesystem} from "../../src/app/game-model/gamesystems/Gamesystem";
import {ScriptAccount} from "../../../src/app/game-model/scriptAccounts/ScriptAccount";
import {ModelComponentType} from "../../../src/app/game-model/ModelComponentType";
import {SimpleGamesystem} from "../../../src/app/game-model/gamesystems/SimpleGamesystem";
import exp = require("node:constants");
import {end} from "electron-debug";
import {GamesystemTrainer} from "./GamesystemTrainer";
import {ProductGamesystem} from "../../../src/app/game-model/gamesystems/ProductGamesystem";
import {ProductStateTrainer} from "./ProductStateTrainer";
import {SimpleState} from "../../../../src/app/game-model/gamesystems/states/SimpleState";
test.describe('Test Check Equal of Innerstates', () => {
test("Test invalid input for equal checking", async()=> {
const gamesystem = ProductStateTrainer.givenFullProductGamesystemWithTwoStates();
expect(gamesystem.states[0].equalInnerStates(null)).toBeFalsy();
expect(gamesystem.states[0].equalInnerStates(undefined)).toBeFalsy();
})
test("Test empty input for equal checking", async ()=> {
const gamesystem = ProductStateTrainer.givenFullProductGamesystemWithTwoStates();
expect(gamesystem.states[0].equalInnerStates([])).toBeFalsy();
})
test("Test identical inner states for equal", async ()=> {
const gamesystem = ProductStateTrainer.givenFullProductGamesystemWithTwoStates();
expect(gamesystem.states[0].equalInnerStates(gamesystem.states[0].innerStates)).toBeTruthy();
})
test("Test slightly derivating inner states for Equal", async ()=> {
const gamesystem = ProductStateTrainer.givenFullProductGamesystemWithTwoStates();
expect(gamesystem.states[0].equalInnerStates(gamesystem.states[1].innerStates)).toBeFalsy();
})
});