fix(store): add test for moving to the last position
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Peter Stuifzand 2021-08-24 21:46:57 +02:00
parent 22edb6165b
commit 8167f6d85d

View File

@ -206,13 +206,13 @@ describe("A store", function () {
store.moveBefore("_e", "_c") store.moveBefore("_e", "_c")
let debug = store.debug(); let debug = store.debug();
expect(debug.idList).toEqual(["_a", "_b", "_e", "_c", "_d"]) expect(debug.idList).toEqual(["_a", "_b", "_e", "_c", "_d"])
expect(debug.result).toEqual([ expect(debug.result[2]).toEqual({text: "e", id: "_e", indented: 2})
{text: "a", id: "_a", indented: 0}, })
{text: "b", id: "_b", indented: 1}, it("moveBefore _d, at-end", function () {
{text: "e", id: "_e", indented: 2}, store.moveBefore("_d", "at-end")
{text: "c", id: "_c", indented: 2}, let debug = store.debug();
{text: "d", id: "_d", indented: 3}, expect(debug.idList).toEqual(["_a", "_b", "_c", "_e", "_d"])
]) expect(debug.result[4]).toEqual({text: "d", id: "_d", indented: 0})
}) })
}) })
}) })