-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: 馃幐 added getFlattenedTreePaths selector
added a selector that crawls a tree, flattens it for visible nodes and creates an array with the path to reach the node on the original tree
- Loading branch information
1 parent
ec1c68a
commit ea17dae
Showing
3 changed files
with
54 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,12 @@ | ||
import {getFlattenedTree} from '../getFlattenedTree'; | ||
import {getFlattenedTree, getFlattenedTreePaths} from '../getFlattenedTree'; | ||
import {Nodes} from '../../../testData/sampleTree'; | ||
|
||
describe('getFlattenedTree', () => { | ||
it('should match snapshot', () => { | ||
expect(getFlattenedTree(Nodes)).toMatchSnapshot(); | ||
}); | ||
}); | ||
|
||
test('getFlattenedTreePaths, should match snapshot', () => { | ||
expect(getFlattenedTreePaths(Nodes)).toMatchSnapshot(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters