Skip to content

Commit

Permalink
fix socketApi unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
muratmerdoglu-dp committed Apr 25, 2024
1 parent e486b9e commit 6a82b5e
Showing 1 changed file with 0 additions and 153 deletions.
153 changes: 0 additions & 153 deletions src/modules/data/board/boardActions/socketApi.unit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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();
Expand All @@ -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();
Expand Down Expand Up @@ -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();
Expand All @@ -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();
Expand All @@ -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();
Expand All @@ -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();
Expand Down

0 comments on commit 6a82b5e

Please sign in to comment.