       expandSelection "left", ->
         assertLocationRange([0,0], [0,3])
         done()
+
+insertString = (string) ->
+  getComposition().insertString(string)
+  render()
+
+insertFile = (file) ->
+  getComposition().insertFile(file)
+  render()
+
+render = ->
+  getEditorController().render()

      done()

editorTest "move cursor around attachment and text", (done) ->
  getComposition().insertString("a")
  getComposition().insertFile(createFile())
  getComposition().insertString("b")
  assertLocationRange([0,3])
  moveCursor "left", ->
    assertLocationRange([0,2])

        done()

editorTest "expand selection over attachment", (done) ->
  insertFile(createFile())
  assertLocationRange([0,1])
  expandSelection "left", ->
    assertLocationRange([0,0], [0,1])
