From 8167f6d85d93adbf2b238963d19b1e80ea218864 Mon Sep 17 00:00:00 2001 From: Peter Stuifzand Date: Tue, 24 Aug 2021 21:46:57 +0200 Subject: [PATCH] fix(store): add test for moving to the last position --- list-editor/spec/store.spec.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/list-editor/spec/store.spec.js b/list-editor/spec/store.spec.js index 24a904d..be2a3b9 100644 --- a/list-editor/spec/store.spec.js +++ b/list-editor/spec/store.spec.js @@ -206,13 +206,13 @@ describe("A store", function () { store.moveBefore("_e", "_c") let debug = store.debug(); expect(debug.idList).toEqual(["_a", "_b", "_e", "_c", "_d"]) - expect(debug.result).toEqual([ - {text: "a", id: "_a", indented: 0}, - {text: "b", id: "_b", indented: 1}, - {text: "e", id: "_e", indented: 2}, - {text: "c", id: "_c", indented: 2}, - {text: "d", id: "_d", indented: 3}, - ]) + expect(debug.result[2]).toEqual({text: "e", id: "_e", indented: 2}) + }) + it("moveBefore _d, at-end", function () { + store.moveBefore("_d", "at-end") + let debug = store.debug(); + expect(debug.idList).toEqual(["_a", "_b", "_c", "_e", "_d"]) + expect(debug.result[4]).toEqual({text: "d", id: "_d", indented: 0}) }) }) })