How to use the prosemirror-test-builder.pre function in prosemirror-test-builder

To help you get started, we’ve selected a few prosemirror-test-builder examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ProseMirror / prosemirror-view / test / test-draw.js View on Github external
it("doesn't redraw siblings of a split node", () => {
    let view = tempEditor({doc: doc(p("foo"), h1("bar"), pre("baz"))})
    let oldP = view.dom.querySelector("p")
    let oldPre = view.dom.querySelector("pre")
    view.dispatch(view.state.tr.split(8))
    ist(view.dom.querySelector("p"), oldP)
    ist(view.dom.querySelector("pre"), oldPre)
  })
github ProseMirror / prosemirror-transform / test / test-trans.js View on Github external
it("can change multiple blocks", () =>
       type(doc(h1("<a>hello"), p("there"), p("<b>you"), p("end")),
            doc(pre("hello"), pre("there"), pre("you"), p("end")),
            "code_block"))
</b></a>
github ProseMirror / prosemirror-commands / test / test-commands.js View on Github external
it("clears nodes from joined node that wouldn't be allowed in target node", () =&gt;
     apply(doc(pre("foo<a>"), p("bar", img)), joinForward, doc(pre("foo</a><a>bar"))))
</a>
github ProseMirror / prosemirror-model / test / test-content.js View on Github external
it("completes a count", () =>
       fill3("code_block{3} paragraph{3}",
             doc(pre()), doc(p()), doc(), doc(pre(), pre()), doc(p(), p())))
github ProseMirror / prosemirror-transform / test / test-trans.js View on Github external
it("clears markup when necessary", () =&gt;
       type(doc(p("hello<a> ", em("world"))),
            doc(pre("hello world")),
            "code_block"))
</a>
github ProseMirror / prosemirror-transform / test / test-trans.js View on Github external
it("skips nodes that can't be changed due to constraints", () =&gt;
       type(doc(p("<a>hello", img), p("okay"), ul(li(p("foo<b>")))),
            doc(pre("</b></a><b><a>hello"), pre("okay"), ul(li(p("foo<b>")))),
            "code_block"))
  })</b></a></b>
github ProseMirror / prosemirror-commands / test / test-commands.js View on Github external
it("can make a block a code block", () =&gt;
     apply(doc(h1("fo<a>o")), setCode, doc(pre("foo"))))
</a>
github ProseMirror / prosemirror-commands / test / test-commands.js View on Github external
it("clears marks when necessary", () =&gt;
     apply(doc(p("fo<a>o", em("bar"))), setCode, doc(pre("foobar"))))
</a>