Sha256: 185674df0193632fab20665d01d4668c1af6136c359ad8e92af78c02ef420ca3
Contents?: true
Size: 1004 Bytes
Versions: 10
Compression:
Stored size: 1004 Bytes
Contents
import { createBasicEditor } from "src/decidim/editor/test/helpers"; import Dialog from "src/decidim/editor/extensions/dialog"; describe("Dialog", () => { let editor = null; let editorElement = null; beforeEach(() => { document.body.innerHTML = ""; editor = createBasicEditor({ extensions: [Dialog] }) editorElement = editor.view.dom; }); it("does not add extra class by default", () => { expect(editorElement.classList.contains("dialog-open")).toBe(false); }); it("adds the correct class to the element when toggled", async () => { editor.commands.toggleDialog(true); expect(editorElement.classList.contains("dialog-open")).toBe(true); }); it("removes the correct class from the element when disabled", async () => { editor.commands.toggleDialog(true); expect(editorElement.classList.contains("dialog-open")).toBe(true); editor.commands.toggleDialog(false); expect(editorElement.classList.contains("dialog-open")).toBe(false); }); });
Version data entries
10 entries across 10 versions & 1 rubygems