From b6833effc19d108f18b892005aff68d9e5de30a0 Mon Sep 17 00:00:00 2001 From: Fabien Winkler Date: Mon, 18 Sep 2023 21:32:30 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=AA=20adding=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/drawer.test.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/drawer.test.ts b/tests/drawer.test.ts index 8953983..2be8eb2 100644 --- a/tests/drawer.test.ts +++ b/tests/drawer.test.ts @@ -25,7 +25,14 @@ describe("Drawer", () => { expect(drawer.$toolbar).toBeUndefined(); }); - it("Init drawer width custom toolbar", () => { + it("Init drawer with default toolbar", () => { + const drawer = new Drawer(document.body.querySelector("#test") as HTMLDivElement); + + expect(drawer.$toolbar).toBeInstanceOf(HTMLDivElement); + expect(drawer.$toolbar.querySelectorAll("button, input").length).toEqual(12); + }); + + it("Init drawer with custom toolbar", () => { const drawer = new Drawer( document.body.querySelector("#test") as HTMLDivElement, { defaultToolbar: false, autoSave: false } @@ -82,6 +89,6 @@ describe("Drawer", () => { drawer.changeTool("eraser"); expect(drawer.activeTool).toEqual("eraser"); expect(drawer.$eraserBtn.classList.contains("active")).toEqual(true); - }) + }); });