Skip to content

Commit

Permalink
Modified tests to fit new Rectangle calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanR712 committed May 9, 2024
1 parent dafa21a commit cf48dac
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions tests/AEGTree/AEGTree.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ describe("AEGTree remove soliloquy:", () => {
});

test("Removing a child of the tree one level deep should be successful.", () => {
tree.insert(new AtomNode("A", new Point(0, 4), 3, 3));
tree.insert(new AtomNode("A", new Point(0, 0), 3, 3));
expect(tree.remove(new Point(2, 2))).toBeTruthy();
});

Expand Down Expand Up @@ -145,8 +145,8 @@ describe("AEGTree clear soliloquy:", () => {

const tree2: AEGTree = new AEGTree();

tree2.insert(new AtomNode("C", origin, 2, 2));
tree2.insert(new AtomNode("P", new Point(origin.x + 5, origin.y + 5), 3, 3));
tree2.insert(new AtomNode("C", origin, 1, 1));
tree2.insert(new AtomNode("P", new Point(origin.x + 4, origin.y + 4), 1, 1));
tree2.insert(new CutNode(testEllipse));

test("AEGTree with several children should have no children after clear call.", () => {
Expand Down
4 changes: 2 additions & 2 deletions tests/AEGTree/AtomNode.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {describe, expect, test} from "vitest";
import {AtomNode} from "../../src/AEG/AtomNode";
import {Point} from "../../src/AEG/Point";

const atom: AtomNode = new AtomNode("A", new Point(0, 10), 10, 10);
const atom: AtomNode = new AtomNode("A", new Point(0, 0), 10, 10);

describe("AtomNode constructor soliloquy:", () => {
const pt: Point = new Point(0, 0);
Expand All @@ -32,7 +32,7 @@ describe("AtomNode constructor soliloquy:", () => {

test("AtomNode construction with identifier A and Rectangle with TL vertex (0, 10) and {h, w} = 10 should produce accurate apt results.", () => {
expect(atom.identifier).toBe("A");
expect(atom.origin).toStrictEqual(new Point(0, 10));
expect(atom.origin).toStrictEqual(new Point(0, 0));
expect(atom.width).toBe(10);
expect(atom.height).toBe(10);
});
Expand Down
8 changes: 4 additions & 4 deletions tests/AEGTree/CutNode.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ describe("CutNode remove soliloquy:", () => {
});

test("Removing a child of the Sheet of Assertion should be successful.", () => {
sheetNode.child = new AtomNode("H", new Point(0, 4), 3, 3);
sheetNode.child = new AtomNode("H", new Point(0, 0), 3, 3);
expect(sheetNode.remove(new Point(2, 2))).toBeTruthy();
expect(sheetNode.children.length).toBe(0);
});
Expand All @@ -243,7 +243,7 @@ describe("CutNode remove soliloquy:", () => {
});

test("Removing an AtomNode one level deep should be successful.", () => {
cNode.child = new AtomNode("A", new Point(4, 6), 2, 2);
cNode.child = new AtomNode("A", new Point(4, 4), 2, 2);
expect(cNode.remove(testCenter)).toBeTruthy();
expect(cNode.children.length).toBe(0);
});
Expand All @@ -261,7 +261,7 @@ describe("CutNode remove soliloquy:", () => {
});

test("Removing a CutNode with children two cut levels deep should be successful.", () => {
const dee: AtomNode = new AtomNode("D", new Point(4, 6), 2, 2);
const dee: AtomNode = new AtomNode("D", new Point(4, 4), 2, 2);
const childCut: CutNode = new CutNode(new Ellipse(testCenter, 4, 4));
childCut.child = dee;

Expand All @@ -272,7 +272,7 @@ describe("CutNode remove soliloquy:", () => {
});

test("Removing a CutNode with children several levels deep should be successful.", () => {
const ell: AtomNode = new AtomNode("L", new Point(4, 6), 1.5, 1.5);
const ell: AtomNode = new AtomNode("L", new Point(4, 4), 1.5, 1.5);
const childCutThreeDeep: CutNode = new CutNode(new Ellipse(testCenter, 2, 2));
const childCutTwoDeep: CutNode = new CutNode(new Ellipse(testCenter, 3, 3));
const childCutOneDeep: CutNode = new CutNode(new Ellipse(testCenter, 4, 4));
Expand Down

0 comments on commit cf48dac

Please sign in to comment.