[TextEditor.Tests] Fixed a potential race condition in the unit tests.