From e4696eca31190855d76e3ae45c43dd872d889b77 Mon Sep 17 00:00:00 2001 From: Viktoriia <1> Date: Wed, 11 Oct 2023 10:09:06 +0200 Subject: [PATCH] Add tests --- .../AddElementDialog.composable.unit.ts | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/src/components/feature-board/shared/AddElementDialog.composable.unit.ts b/src/components/feature-board/shared/AddElementDialog.composable.unit.ts index 3b4e686f8b..86ba40beb2 100644 --- a/src/components/feature-board/shared/AddElementDialog.composable.unit.ts +++ b/src/components/feature-board/shared/AddElementDialog.composable.unit.ts @@ -101,7 +101,7 @@ describe("ElementTypeSelection Composable", () => { env: Partial = { FEATURE_COLUMN_BOARD_SUBMISSIONS_ENABLED: true, FEATURE_COLUMN_BOARD_EXTERNAL_TOOLS_ENABLED: true, - FEATURE_TLDRAW_ENABLED: false, + FEATURE_TLDRAW_ENABLED: true, } ) => { const addElementMock = jest.fn(); @@ -241,35 +241,35 @@ describe("ElementTypeSelection Composable", () => { expect(closeDialogMock).toBeCalledTimes(1); }); }); - // describe("when the DrawingElement action is called", () => { - // it("should call drawing element function with right argument", async () => { - // const { elementTypeOptions, addElementMock } = setup(); - // const { askType } = useAddElementDialog(addElementMock, { - // value: { elements: [] }, - // }); + describe("when the DrawingElement action is called", () => { + it("should call drawing element function with right argument", async () => { + const { elementTypeOptions, addElementMock } = setup(); + const { askType } = useAddElementDialog(addElementMock, { + value: { elements: [] }, + }); - // askType(); + askType(); - // const action = elementTypeOptions.value[4].action; - // action(); + const action = elementTypeOptions.value[4].action; + action(); - // expect(addElementMock).toBeCalledTimes(1); - // expect(addElementMock).toBeCalledWith(ContentElementType.Drawing); - // }); + expect(addElementMock).toBeCalledTimes(1); + expect(addElementMock).toBeCalledWith(ContentElementType.Drawing); + }); - // it("should set isDialogOpen to false", async () => { - // const { elementTypeOptions, addElementMock, closeDialogMock } = setup(); - // const { askType } = useAddElementDialog(addElementMock, { - // value: { elements: [] }, - // }); + it("should set isDialogOpen to false", async () => { + const { elementTypeOptions, addElementMock, closeDialogMock } = setup(); + const { askType } = useAddElementDialog(addElementMock, { + value: { elements: [] }, + }); - // askType(); + askType(); - // const action = elementTypeOptions.value[4].action; - // action(); + const action = elementTypeOptions.value[4].action; + action(); - // expect(closeDialogMock).toBeCalledTimes(1); - // }); - // }); + expect(closeDialogMock).toBeCalledTimes(1); + }); + }); }); });