diff --git a/src/_DataStructures_/Trees/BinaryTree/bottom-view-binary-tree/BottomViewBinaryTree.test.js b/src/_DataStructures_/Trees/BinaryTree/bottom-view-binary-tree/BottomViewBinaryTree.test.js new file mode 100644 index 00000000..ea178f79 --- /dev/null +++ b/src/_DataStructures_/Trees/BinaryTree/bottom-view-binary-tree/BottomViewBinaryTree.test.js @@ -0,0 +1,17 @@ +const BinaryTree = require("../index"); +const bottomView = require('.'); + +describe('Bottom View Binary Tree', () => { + let btree + + beforeEach(() => { + btree = new BinaryTree([1, 2, 3, 4, 5, 6]); + }); + + it('Should determine the bottom view of a binary tree', () => { + expect(bottomView(btree)).toEqual([6, 2, 3, 4]); + }); + it('Should handle null binary tree', () => { + expect(bottomView(null)).toEqual([]); + }); +});