For JS API 4.33 and 4.34
I have notice that the componentOnReady() function for map legend component was not observed during runtime.
let arcgisMap = document.querySelector('arcgis-map');
let widget = document.createElement('arcgis-legend');
arcgisMap.appendChild(widget);
await widget.componentOnReady();
console.log(arcgisMap.querySelector('.arcgis-legend'));`.arcgis-legend` class is one of the style class names used for the rendered legend component element structure.
When monitoring code executing in the web browser's dev console, if you set breakpoints on lines 5 and 7, you will see that when execution is halted on line 7, the legend component has not yet been constructed, even though the component has supposedly reached ready state according to line 5. Is this a bug?