I'm not sure if this is a proper way to test this. Couldn't we have at some point more gutter elements other than line numbers? In that case, I'd expect the gutter element to remain visible even if line numbers are not. 

We could check for the _.CodeMirror-gutter .CodeMirror-linenumbers_ or something like that