diff --git a/lighthouse-core/test/report/html/renderer/report-ui-features-test.js b/lighthouse-core/test/report/html/renderer/report-ui-features-test.js index 3a761fbc3060..92bd5753637a 100644 --- a/lighthouse-core/test/report/html/renderer/report-ui-features-test.js +++ b/lighthouse-core/test/report/html/renderer/report-ui-features-test.js @@ -353,6 +353,22 @@ describe('ReportUIFeatures', () => { createDiv = () => dom.document().createElement('div'); }); + it('should return undefined when nodes is empty', () => { + const nodes = []; + + const nextNode = dropDown._getNextSelectableNode(nodes); + + assert.strictEqual(nextNode, undefined); + }); + + it('should return the only node when start is defined', () => { + const node = createDiv(); + + const nextNode = dropDown._getNextSelectableNode([node], node); + + assert.strictEqual(nextNode, node); + }); + it('should return first node when start is undefined', () => { const nodes = [createDiv(), createDiv()];