From 6a82b5e78c318342e5ba22a15706ffc92db369ea Mon Sep 17 00:00:00 2001 From: Murat Merdoglu Date: Thu, 25 Apr 2024 09:54:36 +0200 Subject: [PATCH] fix socketApi unit tests --- .../data/board/boardActions/socketApi.unit.ts | 153 ------------------ 1 file changed, 153 deletions(-) diff --git a/src/modules/data/board/boardActions/socketApi.unit.ts b/src/modules/data/board/boardActions/socketApi.unit.ts index 64d6c4aa59..247cde4450 100644 --- a/src/modules/data/board/boardActions/socketApi.unit.ts +++ b/src/modules/data/board/boardActions/socketApi.unit.ts @@ -71,57 +71,6 @@ describe("useSocketApi", () => { }); }); - describe("createCardFailure", () => { - it("should call action with correct parameters", () => { - const { createCardFailure } = useSocketApi(); - createCardFailure({ - type: "create-card-failure", - payload: { error: "error" as unknown as Error }, - }); - expect(mockedBoardStore.dispatch).toHaveBeenCalledWith({ - type: "notify-error", - payload: { - errorType: "notUpdatedViaSocket", - BoardObjectType: "boardCard", - }, - }); - }); - }); - - describe("createColumnFailure", () => { - it("should call action with correct parameters", () => { - const { createColumnFailure } = useSocketApi(); - createColumnFailure({ - type: "create-column-failure", - payload: { error: "error" as unknown as Error }, - }); - expect(mockedBoardStore.dispatch).toHaveBeenCalledWith({ - type: "notify-error", - payload: { - errorType: "notUpdatedViaSocket", - BoardObjectType: "boardColumn", - }, - }); - }); - }); - - describe("deleteCardFailure", () => { - it("should call action with correct parameters", () => { - const { deleteCardFailure } = useSocketApi(); - deleteCardFailure({ - type: "delete-card-failure", - payload: { error: "error" as unknown as Error }, - }); - expect(mockedBoardStore.dispatch).toHaveBeenCalledWith({ - type: "notify-error", - payload: { - errorType: "notUpdatedViaSocket", - BoardObjectType: "boardCard", - }, - }); - }); - }); - describe("deleteColumnRequest", () => { it("should call action with correct parameters", () => { const { deleteColumnRequest } = useSocketApi(); @@ -136,23 +85,6 @@ describe("useSocketApi", () => { }); }); - describe("deleteColumnFailure", () => { - it("should call action with correct parameters", () => { - const { deleteColumnFailure } = useSocketApi(); - deleteColumnFailure({ - type: "delete-column-failure", - payload: { error: "error" as unknown as Error }, - }); - expect(mockedBoardStore.dispatch).toHaveBeenCalledWith({ - type: "notify-error", - payload: { - errorType: "notUpdatedViaSocket", - BoardObjectType: "boardColumn", - }, - }); - }); - }); - describe("moveCardRequest", () => { it("should call action with correct parameters", () => { const { moveCardRequest } = useSocketApi(); @@ -167,23 +99,6 @@ describe("useSocketApi", () => { }); }); - describe("moveCardFailure", () => { - it("should call action with correct parameters", () => { - const { moveCardFailure } = useSocketApi(); - moveCardFailure({ - type: "move-card-failure", - payload: { error: "error" as unknown as Error }, - }); - expect(mockedBoardStore.dispatch).toHaveBeenCalledWith({ - type: "notify-error", - payload: { - errorType: "notUpdatedViaSocket", - BoardObjectType: "boardCard", - }, - }); - }); - }); - describe("moveColumnRequest", () => { it("should call action with correct parameters", () => { const { moveColumnRequest } = useSocketApi(); @@ -212,23 +127,6 @@ describe("useSocketApi", () => { }); }); - describe("moveColumnFailure", () => { - it("should call action with correct parameters", () => { - const { moveColumnFailure } = useSocketApi(); - moveColumnFailure({ - type: "move-column-failure", - payload: { error: "error" as unknown as Error }, - }); - expect(mockedBoardStore.dispatch).toHaveBeenCalledWith({ - type: "notify-error", - payload: { - errorType: "notUpdatedViaSocket", - BoardObjectType: "boardColumn", - }, - }); - }); - }); - describe("updateColumnTitleRequest", () => { it("should call action with correct parameters", () => { const { updateColumnTitleRequest } = useSocketApi(); @@ -243,23 +141,6 @@ describe("useSocketApi", () => { }); }); - describe("updateColumnTitleFailure", () => { - it("should call action with correct parameters", () => { - const { updateColumnTitleFailure } = useSocketApi(); - updateColumnTitleFailure({ - type: "update-column-title-failure", - payload: { error: "error" as unknown as Error }, - }); - expect(mockedBoardStore.dispatch).toHaveBeenCalledWith({ - type: "notify-error", - payload: { - errorType: "notUpdatedViaSocket", - BoardObjectType: "boardColumn", - }, - }); - }); - }); - describe("updateBoardTitleRequest", () => { it("should call action with correct parameters", () => { const { updateBoardTitleRequest } = useSocketApi(); @@ -274,23 +155,6 @@ describe("useSocketApi", () => { }); }); - describe("updateBoardTitleFailure", () => { - it("should call action with correct parameters", () => { - const { updateBoardTitleFailure } = useSocketApi(); - updateBoardTitleFailure({ - type: "update-board-title-failure", - payload: { error: "error" as unknown as Error }, - }); - expect(mockedBoardStore.dispatch).toHaveBeenCalledWith({ - type: "notify-error", - payload: { - errorType: "notUpdatedViaSocket", - BoardObjectType: "board", - }, - }); - }); - }); - describe("updateBoardVisibilityRequest", () => { it("should call action with correct parameters", () => { const { updateBoardVisibilityRequest } = useSocketApi(); @@ -305,23 +169,6 @@ describe("useSocketApi", () => { }); }); - describe("updateBoardVisibilityFailure", () => { - it("should call action with correct parameters", () => { - const { updateBoardVisibilityFailure } = useSocketApi(); - updateBoardVisibilityFailure({ - type: "update-board-visibility-failure", - payload: { error: "error" as unknown as Error }, - }); - expect(mockedBoardStore.dispatch).toHaveBeenCalledWith({ - type: "notify-error", - payload: { - errorType: "notUpdatedViaSocket", - BoardObjectType: "board", - }, - }); - }); - }); - describe("reloadBoard", () => { it("should call action with correct parameters", () => { const { reloadBoard } = useSocketApi();