How to use the prosemirror-test-builder.strong 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-domchange.js View on Github external
it("recognizes typing inside markup", () => {
    let view = tempEditor({doc: doc(p("a", em("b", img, strong("cd<a>")), "e"))})
    findTextNode(view.dom, "cd").nodeValue = "cdxy"
    flush(view)
    ist(view.state.doc, doc(p("a", em("b", img, strong("cdxy")), "e")), eq)
  })
</a>
github ProseMirror / prosemirror-view / test / test-draw-decoration.js View on Github external
it("draws widgets inside the marks for their side", () => {
    let view = tempEditor({
      doc: doc(p(em("foo"), strong("bar"))),
      plugins: [decoPlugin([Decoration.widget(4, document.createElement("img"), {side: -1})]),
                decoPlugin([Decoration.widget(4, document.createElement("br"))]),
                decoPlugin([Decoration.widget(7, document.createElement("span"))], {side: 1})]
    })
    ist(view.dom.querySelector("em img"))
    ist(!view.dom.querySelector("strong img"))
    ist(view.dom.querySelector("strong br"))
    ist(!view.dom.querySelector("em br"))
    ist(!view.dom.querySelector("strong span"))
  })
github ProseMirror / prosemirror-view / test / test-view.js View on Github external
it("can update with a state using a different schema", () => {
    let testSchema = new Schema({nodes: schema.spec.nodes})
    let view = tempEditor({doc: doc(p(strong("foo")))})
    view.updateState(EditorState.create({doc: testSchema.nodes.doc.createAndFill()}))
    ist(!view.dom.querySelector("strong"))
  })
github ProseMirror / prosemirror-view / test / test-domchange.js View on Github external
it("resolves ambiguous text input", () =&gt; {
    let view = tempEditor({doc: doc(p("fo<a>o"))})
    view.dispatch(view.state.tr.addStoredMark(view.state.schema.marks.strong.create()))
    findTextNode(view.dom, "foo").nodeValue = "fooo"
    flush(view)
    ist(view.state.doc, doc(p("fo", strong("o"), "o")), eq)
  })
</a>
github ProseMirror / prosemirror-view / test / test-domchange.js View on Github external
it("recognizes typing inside markup", () =&gt; {
    let view = tempEditor({doc: doc(p("a", em("b", img, strong("cd<a>")), "e"))})
    findTextNode(view.dom, "cd").nodeValue = "cdxy"
    flush(view)
    ist(view.state.doc, doc(p("a", em("b", img, strong("cdxy")), "e")), eq)
  })
</a>
github ProseMirror / prosemirror-model / test / test-dom.js View on Github external
}

    it("can represent simple node",
       test(doc(p("hello")),
            "<p>hello</p>"))

    it("can represent a line break",
       test(doc(p("hi", br, "there")),
            "<p>hi<br>there</p>"))

    it("can represent an image",
       test(doc(p("hi", img({alt: "x"}), "there")),
            '<p>hi<img alt="x" src="img.png">there</p>'))

    it("joins styles",
       test(doc(p("one", strong("two", em("three")), em("four"), "five")),
            "<p>one<strong>two</strong><em><strong>three</strong>four</em>five</p>"))

    it("can represent links",
       test(doc(p("a ", a({href: "foo"}, "big ", a({href: "bar"}, "nested"), " link"))),
            "<p>a <a href="\&quot;foo\&quot;">big </a><a href="\&quot;bar\&quot;">nested</a><a href="\&quot;foo\&quot;"> link</a></p>"))

    it("can represent and unordered list",
       test(doc(ul(li(p("one")), li(p("two")), li(p("three", strong("!")))), p("after")),
            "<ul><li><p>one</p></li><li><p>two</p></li><li><p>three<strong>!</strong></p></li></ul><p>after</p>"))

    it("can represent an ordered list",
       test(doc(ol(li(p("one")), li(p("two")), li(p("three", strong("!")))), p("after")),
            "<ol><li><p>one</p></li><li><p>two</p></li><li><p>three<strong>!</strong></p></li></ol><p>after</p>"))

    it("can represent a blockquote",
       test(doc(blockquote(p("hello"), p("bye"))),
github ProseMirror / prosemirror-view / test / test-domchange.js View on Github external
it("can delete text in markup", () =&gt; {
    let view = tempEditor({doc: doc(p("a", em("b", img, strong("cd<a>")), "e"))})
    findTextNode(view.dom, "cd").nodeValue = "c"
    flush(view)
    ist(view.state.doc, doc(p("a", em("b", img, strong("c")), "e")), eq)
  })
</a>
github ProseMirror / prosemirror-transform / test / test-trans.js View on Github external
it("should only add a mark once", () =&gt;
       add(doc(p("hello ", strong("<a>there"), "!<b>")),
           schema.mark("strong"),
           doc(p("hello ", strong("there!")))))
</b></a>