* @param {Element} liveList * @param {Element} node
(liveList, node)
| 640 | * @param {Element} node |
| 641 | */ |
| 642 | function liveListInsert(liveList, node) { |
| 643 | const iterCount = Math.floor(Math.random() * 2) + 1; |
| 644 | logWithoutTimestamp(`inserting ${iterCount} item(s)`); |
| 645 | for (let i = 0; i < iterCount; i++) { |
| 646 | /** |
| 647 | * TODO(#28387) this type cast may be hiding a bug. |
| 648 | * @type {Element} |
| 649 | */ |
| 650 | const child = /** @type {*} */ (node.cloneNode(true)); |
| 651 | child.setAttribute('id', `list-item-${itemCtr++}`); |
| 652 | child.setAttribute('data-sort-time', Date.now().toString()); |
| 653 | liveList.querySelector('[items]')?.appendChild(child); |
| 654 | } |
| 655 | } |
| 656 | |
| 657 | /** |
| 658 | * @param {Element} liveList |
no test coverage detected