Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions js/__tests__/planetInterface.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const mockActivity = {
prepSearchWidget: jest.fn(),
sendAllToTrash: jest.fn(),
refreshCanvas: jest.fn(),
_loadStart: jest.fn(),
justLoadStart: jest.fn(),
doLoadAnimation: jest.fn(),
textMsg: jest.fn(),
stage: { enableDOMEvents: jest.fn(), update: jest.fn() },
Expand Down Expand Up @@ -108,31 +108,31 @@ describe("PlanetInterface", () => {
});

test("openPlanet calls saveLocally, hideMusicBlocks, and showPlanet", () => {
jest.spyOn(planetInterface, "saveLocally").mockImplementation(() => {});
jest.spyOn(planetInterface, "hideMusicBlocks").mockImplementation(() => {});
jest.spyOn(planetInterface, "showPlanet").mockImplementation(() => {});
jest.spyOn(planetInterface, "saveLocally").mockImplementation(() => { });
jest.spyOn(planetInterface, "hideMusicBlocks").mockImplementation(() => { });
jest.spyOn(planetInterface, "showPlanet").mockImplementation(() => { });
planetInterface.openPlanet();
expect(planetInterface.saveLocally).toHaveBeenCalled();
expect(planetInterface.hideMusicBlocks).toHaveBeenCalled();
expect(planetInterface.showPlanet).toHaveBeenCalled();
});

test("closePlanet calls hidePlanet and showMusicBlocks", () => {
jest.spyOn(planetInterface, "hidePlanet").mockImplementation(() => {});
jest.spyOn(planetInterface, "showMusicBlocks").mockImplementation(() => {});
jest.spyOn(planetInterface, "hidePlanet").mockImplementation(() => { });
jest.spyOn(planetInterface, "showMusicBlocks").mockImplementation(() => { });
planetInterface.closePlanet();
expect(planetInterface.hidePlanet).toHaveBeenCalled();
expect(planetInterface.showMusicBlocks).toHaveBeenCalled();
});

test("newProject calls closePlanet, initialiseNewProject, _loadStart, and saveLocally", () => {
jest.spyOn(planetInterface, "closePlanet").mockImplementation(() => {});
jest.spyOn(planetInterface, "initialiseNewProject").mockImplementation(() => {});
jest.spyOn(planetInterface, "saveLocally").mockImplementation(() => {});
test("newProject calls closePlanet, initialiseNewProject, justLoadStart, and saveLocally", () => {
jest.spyOn(planetInterface, "closePlanet").mockImplementation(() => { });
jest.spyOn(planetInterface, "initialiseNewProject").mockImplementation(() => { });
jest.spyOn(planetInterface, "saveLocally").mockImplementation(() => { });
planetInterface.newProject();
expect(planetInterface.closePlanet).toHaveBeenCalled();
expect(planetInterface.initialiseNewProject).toHaveBeenCalled();
expect(mockActivity._loadStart).toHaveBeenCalled();
expect(mockActivity.justLoadStart).toHaveBeenCalled();
expect(planetInterface.saveLocally).toHaveBeenCalled();
});
test("onConverterLoad sets window.Converter", () => {
Expand Down Expand Up @@ -248,7 +248,7 @@ describe("PlanetInterface", () => {
setOnConverterLoad: jest.fn()
};

win.makePlanet = jest.fn(async () => {});
win.makePlanet = jest.fn(async () => { });
win.p = stubPlanet;

await planetInterface.init();
Expand Down Expand Up @@ -294,7 +294,7 @@ describe("PlanetInterface", () => {

global.createjs = {
Bitmap: class {
constructor(img) {}
constructor(img) { }
getBounds() {
return { x: 0, y: 0, width: 1, height: 1 };
}
Expand Down
8 changes: 6 additions & 2 deletions js/blocks/__tests__/GraphicsBlocks.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ global.ValueBlock = class {
}
};

global.FlowBlock = class extends global.ValueBlock {};
global.FlowBlock = class extends global.ValueBlock { };
global.FlowClampBlock = class extends global.FlowBlock {
makeMacro = jest.fn();
};
Expand Down Expand Up @@ -80,7 +80,11 @@ describe("GraphicsBlocks", () => {
};

activity = {
blocks: {},
blocks: {
blockList: {
0: { connections: [null] }
}
},
errorMsg: jest.fn(),
turtles: {
companionTurtle: jest.fn(() => 0),
Expand Down
2 changes: 1 addition & 1 deletion js/planetInterface.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ class PlanetInterface {
this.newProject = () => {
this.closePlanet();
this.initialiseNewProject();
this.activity._loadStart();
this.activity.justLoadStart();
this.saveLocally();
};

Expand Down
Loading