Test doesnt find <rect> elements with class "item-legend"

I’m working on the treemap in the D3 certification. The treemap itself is done, but now the test for the legend doesnt find the rect elements with the class"item-legend" and also not that they have at least 2 different fill colors.

my codepen is https://codepen.io/tlaschkolnig/pen/qBQGYVN

when I check the website with console, I see the rect elements with the proper class:

any idea why this is not passing?

You have multiple rects with the id of legend. This is not allowed in HTML, ids must be unique, so only one element on the page can have the id of legend.

The rect elements with a class of legend-item should be children of the #legend element in order to satisfy the requirements of the test.

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.