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

Version Path
decidim-core-0.29.1 app/packs/src/decidim/editor/test/extensions/dialog.test.js
decidim-core-0.28.4 app/packs/src/decidim/editor/test/extensions/dialog.test.js
decidim-core-0.29.0 app/packs/src/decidim/editor/test/extensions/dialog.test.js
decidim-core-0.28.3 app/packs/src/decidim/editor/test/extensions/dialog.test.js
decidim-core-0.29.0.rc4 app/packs/src/decidim/editor/test/extensions/dialog.test.js
decidim-core-0.29.0.rc3 app/packs/src/decidim/editor/test/extensions/dialog.test.js
decidim-core-0.29.0.rc2 app/packs/src/decidim/editor/test/extensions/dialog.test.js
decidim-core-0.29.0.rc1 app/packs/src/decidim/editor/test/extensions/dialog.test.js
decidim-core-0.28.2 app/packs/src/decidim/editor/test/extensions/dialog.test.js
decidim-core-0.28.1 app/packs/src/decidim/editor/test/extensions/dialog.test.js