Skip to content

Commit

Permalink
Adjust tests to change in mapResult's behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
marijnh committed Oct 11, 2016
1 parent f83b7b2 commit db7948d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/test-rebase.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,14 @@ describe("rebaseSteps", () => {
rebase$(doc(p("hello<1> wo<2>rld<3>!")),
tr => tr.delete(6, 12),
tr => type(tr, 9, "X"),
doc(p("hello<1><3>!")))
doc(p("hello<3>!")))
})

it("allows deleting the same content twice", () => {
rebase(doc(p("hello<1> wo<2>rld<3>!")),
tr => tr.delete(6, 12),
tr => tr.delete(6, 12),
doc(p("hello<1><3>!")))
doc(p("hello<3>!")))
})

it("isn't confused by joining a block that's being edited", () => {
Expand Down Expand Up @@ -135,7 +135,7 @@ describe("rebaseSteps", () => {
rebase(doc(p("b<before>efore"), blockquote(ul(li(p("o<1>ne")), li(p("t<2>wo")), li(p("thr<3>ee")))), p("a<after>fter")),
tr => tr.replace(tr.doc.tag[1], tr.doc.tag[3], doc(p("a"), blockquote(p("b")), p("c")).slice(2, 9)),
tr => type(tr, tr.doc.tag[2], "ayay"),
doc(p("b<before>efore"), blockquote(ul(li(p("o<1>"), blockquote(p("b")), p("<3>ee")))), p("a<after>fter")))
doc(p("b<before>efore"), blockquote(ul(li(p("o"), blockquote(p("b")), p("<3>ee")))), p("a<after>fter")))
})

it("maps through inserts", () => {
Expand All @@ -149,14 +149,14 @@ describe("rebaseSteps", () => {
rebase(doc(p("a"), "<1>", p("b"), "<2>", p("c")),
tr => tr.delete(tr.doc.tag[1], tr.doc.tag[2]),
tr => tr.delete(tr.doc.tag[1], tr.doc.tag[2]),
doc(p("a"), "<1><2>", p("c")))
doc(p("a"), "<2>", p("c")))
})

it("discards edits in removed blocks", () => {
rebase$(doc(p("a"), "<1>", p("b<2>"), "<3>", p("c")),
tr => tr.delete(tr.doc.tag[1], tr.doc.tag[3]),
tr => type(tr, tr.doc.tag[2], "ay"),
doc(p("a"), "<1><3>", p("c")))
doc(p("a"), "<3>", p("c")))
})

it("preserves double block inserts", () => {
Expand Down

0 comments on commit db7948d

Please sign in to comment.