Updating tests to use trim() before comparing strings