mirror of
https://github.com/stan-smith/FossFLOW.git
synced 2025-12-27 00:19:14 -05:00
fix: tests not passing
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import { makeAutoObservable } from "mobx";
|
||||
import autoBind from "auto-bind";
|
||||
import { Renderer } from "../renderer/Renderer";
|
||||
import { ModeBase } from "./ModeBase";
|
||||
import { Mouse } from "./types";
|
||||
@@ -14,7 +13,6 @@ export class ModeManager {
|
||||
|
||||
constructor() {
|
||||
makeAutoObservable(this);
|
||||
autoBind(this);
|
||||
}
|
||||
|
||||
setRenderer(renderer: Renderer) {
|
||||
|
||||
@@ -12,7 +12,7 @@ describe("Mode manager functions correctly", () => {
|
||||
const exitSpy = jest.spyOn(TestMode.prototype, "exit");
|
||||
const eventSpy = jest.spyOn(TestMode.prototype, "TEST_EVENT");
|
||||
const mouseEventSpy = jest.spyOn(TestMode.prototype, "MOUSE_MOVE");
|
||||
const renderer = new Renderer({} as unknown as HTMLDivElement);
|
||||
const renderer = new Renderer({} as unknown as HTMLDivElement, () => {});
|
||||
const modeManager = new ModeManager();
|
||||
modeManager.setRenderer(renderer);
|
||||
modeManager.activateMode(TestMode);
|
||||
|
||||
12
src/tests/fixtures/scene.ts
vendored
12
src/tests/fixtures/scene.ts
vendored
@@ -18,16 +18,28 @@ export const scene: SceneI = {
|
||||
id: "node1",
|
||||
label: "Node1",
|
||||
icon: "icon1",
|
||||
position: {
|
||||
x: 0,
|
||||
y: 0,
|
||||
},
|
||||
},
|
||||
{
|
||||
id: "node2",
|
||||
label: "Node2",
|
||||
icon: "icon2",
|
||||
position: {
|
||||
x: 1,
|
||||
y: 1,
|
||||
},
|
||||
},
|
||||
{
|
||||
id: "node3",
|
||||
label: "Node3",
|
||||
icon: "icon1",
|
||||
position: {
|
||||
x: 2,
|
||||
y: 2,
|
||||
},
|
||||
},
|
||||
],
|
||||
connectors: [
|
||||
|
||||
@@ -23,7 +23,11 @@ describe("scene validation works correctly", () => {
|
||||
|
||||
test("finds invalid nodes in scene", () => {
|
||||
const { icons } = scene;
|
||||
const invalidNode = { id: "invalidNode", label: null, icon: "doesntExist" };
|
||||
const invalidNode = {
|
||||
id: "invalidNode",
|
||||
icon: "doesntExist",
|
||||
position: { x: -1, y: -1 },
|
||||
};
|
||||
const nodes: NodeI[] = [...scene.nodes, invalidNode];
|
||||
|
||||
const result = findInvalidNode(nodes, icons);
|
||||
|
||||
Reference in New Issue
Block a user