The code you have shared works on my end. Please ensure that you have disabled any extensions that interface with the freeCodeCamp website (such as Dark Mode and Ad Blocker), and set your browser zoom level to 100%. Both of these factors can cause tests to fail erroneously.
I’m doing this on my iPad and that’s likely causing the issue. Sometimes it just makes correct code not work for some reason—which I forget about until it decides to throw a wrench in the works.