is an old D3 .on() function call and you’re using D3v7. You’ll need something like
.on("mouseover", (event, datum) => {
which means you need to pass in the date/GDP pair in datum since you don’t have easy access to the outer dataset index. As it is, you’re passing in your scaledPrice which is a float, and the array subscripting to set data-date in data[i][0] is not behaving as intended. It looks like it is using zero everytime, which would explain the behavior the test is reporting.