the test also handles the case of `" "`, which wouldn't work with `elem === ""`