diff --git a/Data-Structures/Array/test/LocalMaximomPoint.test.js b/Data-Structures/Array/test/LocalMaximomPoint.test.js index db7d911949..25689964fd 100644 --- a/Data-Structures/Array/test/LocalMaximomPoint.test.js +++ b/Data-Structures/Array/test/LocalMaximomPoint.test.js @@ -12,7 +12,6 @@ describe('LocalMaximumPoint tests', () => { }) it('test boundary maximum points - should find first maximom point from the top', () => { - // Test a mix of number types (i.e., positive/negative, numbers with decimals, fractions) const Array = [13, 2, 3, 4, 5, 6, 12] expect(LocalMaximomPoint(Array)).toEqual(6) }) @@ -26,4 +25,16 @@ describe('LocalMaximumPoint tests', () => { const Array2 = [13, 16, 5, 41, 3, 2, 1] expect(LocalMaximomPoint(Array2)).toEqual(3) }) + + it('test inner points - repeated local maxima', () => { + const Array2 = [1, 5, 5, 5, 3, 2, 1] + const result = LocalMaximomPoint(Array2) + expect([1, 2, 3]).toContain(result) + }) + + it('test inner points - alternating peaks and valleys', () => { + const Array2 = [1, 3, 2, 4, 3, 5, 4] + const result = LocalMaximomPoint(Array2) + expect([1, 3, 5]).toContain(result) + }) })