diff --git a/src/calltree.js b/src/calltree.js index 1c33ed3..01bf06a 100644 --- a/src/calltree.js +++ b/src/calltree.js @@ -516,7 +516,7 @@ export const expand_path = (state, node) => ({ calltree_node_is_expanded: { ...state.calltree_node_is_expanded, ...Object.fromEntries( - path_to_root(root_calltree_node(state), node) + path_to_root(state.calltree, node) .map(n => [n.id, true]) ), // Also expand node, since it is not included in diff --git a/test/test.js b/test/test.js index 86dd1d7..d549b95 100644 --- a/test/test.js +++ b/test/test.js @@ -2351,6 +2351,10 @@ const y = x()` // Expand call const {state: expanded} = COMMANDS.calltree.click(state, call.id) assert_equal(get_async_calls(expanded)[0].children[0].fn.name, 'fn2') + + // Navigate logs + const nav = COMMANDS.calltree.navigate_logs_position(expanded, 0) + assert_equal(nav.state.current_calltree_node.is_log, true) }), ]