Skip to content

Commit

Permalink
Fixes tests once again
Browse files Browse the repository at this point in the history
  • Loading branch information
matdru committed Jun 20, 2020
1 parent ef17a73 commit f3decd8
Showing 1 changed file with 1 addition and 22 deletions.
23 changes: 1 addition & 22 deletions packages/core/src/events/tests/EventHandlers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ describe("EventHandlers", () => {
beforeEach(() => {
e = {
preventDefault: jest.fn(),
stopImmediatePropagation: jest.fn(),
stopPropagation: jest.fn(),
};

createShadow = jest.fn().mockImplementation(() => shadow);
Expand Down Expand Up @@ -101,7 +99,7 @@ describe("EventHandlers", () => {
let drop;

beforeEach(() => {
e = { preventDefault: jest.fn(), stopPropagation: jest.fn() };
e = { preventDefault: jest.fn() };
drop = eventHandlers.handlers().drop;
});
it("should contain two events, dragover and dragenter", () => {
Expand All @@ -112,7 +110,6 @@ describe("EventHandlers", () => {
it("should have prevented default on dragover", () => {
callHandler(drop.events, "dragover")(e);
expect(e.preventDefault).toHaveBeenCalled();
expect(e.stopPropagation).toHaveBeenCalled();
expect(actions.setIndicator).not.toHaveBeenCalled();
});

Expand All @@ -122,7 +119,6 @@ describe("EventHandlers", () => {
});
it("should have prevented default", () => {
expect(e.preventDefault).toHaveBeenCalled();
expect(e.stopPropagation).toHaveBeenCalled();
});
it("should have not called set indicator or getDropPlacehalder", () => {
expect(actions.setIndicator).not.toHaveBeenCalled();
Expand All @@ -147,7 +143,6 @@ describe("EventHandlers", () => {
});
it("should have prevented default", () => {
expect(e.preventDefault).toHaveBeenCalled();
expect(e.stopPropagation).toHaveBeenCalled();
});
it("should have called getdropPlaceholder with the right arguments", () => {
expect(query.getDropPlaceholder).toHaveBeenCalledWith(
Expand Down Expand Up @@ -217,10 +212,6 @@ describe("EventHandlers", () => {
beforeEach(() => {
callHandler(drag.events, "dragstart")(e, nodeId);
});
it("should have stopped propagation", () => {
expect(e.stopImmediatePropagation).toHaveBeenCalled();
expect(e.stopPropagation).toHaveBeenCalled();
});
it("should call setNodeEvent on mousedown", () => {
expect(actions.setNodeEvent).toHaveBeenCalledWith("dragged", nodeId);
});
Expand All @@ -244,10 +235,6 @@ describe("EventHandlers", () => {
beforeEach(() => {
callHandler(drag.events, "dragend")(e, nodeId);
});
it("should have stopped propagation", () => {
expect(e.stopImmediatePropagation).not.toHaveBeenCalled();
expect(e.stopPropagation).toHaveBeenCalled();
});
it("should have not call move", () => {
expect(actions.move).not.toHaveBeenCalled();
});
Expand Down Expand Up @@ -313,10 +300,6 @@ describe("EventHandlers", () => {
parsedNodeTree = node;
callHandler(create.events, "dragstart")(e, nodeId);
});
it("should have stopped propagation", () => {
expect(e.stopImmediatePropagation).toHaveBeenCalled();
expect(e.stopPropagation).toHaveBeenCalled();
});
it("should call parseReactElement.toNodeTree on mousedown", () => {
expect(query.parseReactElement).toHaveBeenCalled();
});
Expand All @@ -340,10 +323,6 @@ describe("EventHandlers", () => {
beforeEach(() => {
callHandler(create.events, "dragend")(e, nodeId);
});
it("should have stopped propagation", () => {
expect(e.stopImmediatePropagation).not.toHaveBeenCalled();
expect(e.stopPropagation).toHaveBeenCalled();
});
it("should have not call addNodeTree", () => {
expect(actions.addNodeTree).not.toHaveBeenCalled();
});
Expand Down

0 comments on commit f3decd8

Please sign in to comment.