 
         keydown('d', element: editor[0])
         keydown('d', element: editor[0])
+
         expect(editor.getText()).toBe "12345\n\nABCDE"
         expect(editor.getCursorScreenPosition()).toEqual([1,0])
         expect(vimState.getRegister('"').text).toBe "abcde\n"


  describe "the c keybinding", ->
    describe "when followed by a c", ->
      it "deletes the current line and enters insert mode", ->
        editor.setText("12345\nabcde\nABCDE")
        editor.setCursorScreenPosition([1,1])

        keydown('c', element: editor[0])
        keydown('c', element: editor[0])
        expect(editor.getText()).toBe "12345\nABCDE"
        expect(editor.getCursorScreenPosition()).toEqual([1,0])
        expect(editor).not.toHaveClass 'command-mode'
        expect(editor).toHaveClass 'insert-mode'

      it "deletes the last line and enters insert mode", ->
        editor.setText("12345\nabcde\nABCDE")
        editor.setCursorScreenPosition([2,1])
        keydown('c', element: editor[0])
        keydown('c', element: editor[0])
        expect(editor.getText()).toBe "12345\nabcde"
        expect(editor.getCursorScreenPosition()).toEqual([1,0])
        expect(editor).not.toHaveClass 'command-mode'
        expect(editor).toHaveClass 'insert-mode'

      describe "when the second c is prefixed by a count", ->
        it "deletes n lines, starting from the current, and enters insert mode", ->
          editor.setText("12345\nabcde\nABCDE\nQWERT")
          editor.setCursorScreenPosition([1,1])

          keydown('c', element: editor[0])
          keydown('2', element: editor[0])
          keydown('c', element: editor[0])

          expect(editor.getText()).toBe "12345\nQWERT"
          expect(editor.getCursorScreenPosition()).toEqual([1,0])
          expect(editor).not.toHaveClass 'command-mode'
          expect(editor).toHaveClass 'insert-mode'

    describe "when followed by an h", ->
      it "deletes the previous letter on the current line and enters insert mode", ->

      expect(editor.getText()).toBe "012345\n\nabcdef"

  describe "the s keybinding", ->
    beforeEach ->
      editor.setText("012345")
      editor.setCursorScreenPosition([0, 1])

    it "deletes the character to the right and enters insert mode", ->
      keydown('s', element: editor[0])

      expect(editor).toHaveClass 'insert-mode'
      expect(editor.getText()).toBe '02345'
      expect(editor.getCursorScreenPosition()).toEqual [0, 1]
      expect(vimState.getRegister('"').text).toBe '1'

    it "deletes count characters to the right and enters insert mode", ->
      keydown('3', element: editor[0])
      keydown('s', element: editor[0])

      expect(editor).toHaveClass 'insert-mode'
      expect(editor.getText()).toBe '045'
      expect(editor.getCursorScreenPosition()).toEqual [0, 1]
