tests for keeping visual state of autocomplete refactored