Missing instructions and test case for Javascript Hashmap?

Link to the lesson

https://www.codecademy.com/paths/front-end-engineer-career-path/tracks/fecp-22-complex-data-structures/modules/wdcp-22-hash-maps/lessons/learn-hash-maps-javascript/exercises/collisions-looping

Instructions

In step 3 the instructions read:

Add an if statement in the while loop that does a strict equality check of the current node’s .key and key . If the two keys are the same, overwrite the current node’s key and value properties with the key-value pair we want to store.

Right after that it reads:

Outside of the last if statement, write a condition that checks if the current node is the tail node. Check what Node methods are available to you in the Node.js file.

This is how I implemented that and it passed:

if(current.data.key === key){
   current.data = {key, value}
}
if(!current.getNextNode()){
   current.setNextNode(new Node({key, value}))
   break;
}

Question

I wonder why the instructions only ask us to break the loop if the second condition is met (step 5). Why should we continue the while loop if we’ve already overwritten a value?

Result

I tested my code that passed all tests. The linked list seems to be polluted with old values:

Adjustment:

If I break out of the loop if the first condition is met as well, the result seems to make more sense to me:

Did I miss a feature of Hashmaps or should the instructions and the test for passing be extended?