Skip to content

Commit

Permalink
Merge pull request #3 from fztr/fztr-fix-on-current-line
Browse files Browse the repository at this point in the history
Fixes bug in onCurrentLine and adds corresponding test
  • Loading branch information
yishn authored Jan 15, 2021
2 parents 4424e56 + fb30be7 commit 0b74ca3
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
1 change: 0 additions & 1 deletion src/GameTree.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,6 @@ class GameTree {

onCurrentLine(id, currents) {
for (let node of this.listNodesVertically(id, -1, {})) {
if (node.id === id) continue
let {parentId} = node

if (
Expand Down
1 change: 1 addition & 0 deletions tests/GameTree.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ t.test('onCurrentLine method', t => {
t.equal(tree.onCurrentLine(tree.root.id, {}), true)
t.equal(tree.onCurrentLine(subChildId1, {[id1]: childId2}), false)
t.equal(tree.onCurrentLine(subChildId1, {[id1]: childId3}), true)
t.equal(tree.onCurrentLine(childId1, {[id1]: childId2}), false)

t.end()
})
Expand Down

0 comments on commit 0b74ca3

Please sign in to comment.