未验证 提交 9ff5abed 编写于 作者: S Sandeep Somavarapu 提交者: GitHub

Merge pull request #29763 from stringham/fix-search-history

Fix history navigator to change the position when adding an existing element.
......@@ -82,6 +82,14 @@ suite('History Navigator', () => {
assert.deepEqual(['4', '5'], toArray(testObject));
});
test('adding existing element changes the position', function () {
let testObject = new HistoryNavigator(['1', '2', '3', '4'], 5);
testObject.add('2');
assert.deepEqual(['1', '3', '4', '2'], toArray(testObject));
});
test('add resets the navigator to last', function () {
let testObject = new HistoryNavigator(['1', '2', '3', '4'], 3);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册