You need to replace spaces with the unicode before checking. TestCafe has a section about this. is \u00a0
\u00a0
specialCharReplace(text) { // replace spaces of text with \u00a0 return text.replace(/\s/g, "\u00a0"); }