Skip to content

Commit

Permalink
chore: added unit test for #897
Browse files Browse the repository at this point in the history
  • Loading branch information
mweststrate committed Jan 31, 2022
1 parent d8f2636 commit 607b994
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions __tests__/patch.js
Original file line number Diff line number Diff line change
Expand Up @@ -1417,3 +1417,13 @@ describe("#879 delete item from array - 2", () => {
[1, 2, undefined]
)
})

test("#897 appendPatch", () => {
const state0 = {a: []}
const state1 = applyPatches(state0, [{op: "add", path: ["a", "-"], value: 1}])
const state2 = applyPatches(state1, [{op: "add", path: ["a", "-"], value: 2}])
const state3 = applyPatches(state2, [{op: "add", path: ["a", "-"], value: 3}])
expect(state3).toEqual({
a: [1, 2, 3]
})
})

0 comments on commit 607b994

Please sign in to comment.