 describe('Selection', ->
   beforeEach( ->
-    @container = $('#editor-container').html('').get(0)
+    @container = $('#editor-container').get(0)
+    @container.innerHTML = '
+      <div>
+        <div><span>0123</span></div>
+        <div><br></div>
+        <div><img></div>
+        <div><b><s>89</s></b><i>ab</i></div>
+      </div>
+    '
+    @quill = new Quill(@container.firstChild)   # Need Quill to create iframe for focus logic
+    @doc = @quill.editor.doc
+    @selection = @quill.editor.selection
   )
 
-  it('constructor', -> )
-  it('checkFocus', -> )
-  it('getRange', -> )
-  it('preserve', -> )
-  it('setRange', -> )
-  it('shiftAfter', -> )
-  it('update', -> )
-  it('_getNativeRange', -> )
-  it('_setNativeRange', -> )
-
-
   describe('helpers', ->
-    beforeEach( ->
-      @container.innerHTML = '
-        <div>
-          <div><span>0123</span></div>
-          <div><br></div>
-          <div><img></div>
-          <div><b><s>89</s></b><i>ab</i></div>
-        </div>
-      '
-      @doc = new Quill.Document(@container.firstChild, { formats: Quill.DEFAULTS.formats })
-      @emitter = new Quill.Lib.EventEmitter2
-      @selection = new Quill.Selection(@doc, @emitter)
-    )
-
     tests =
       'text node':
         native: ->


      it('empty document', ->
        @container.innerHTML = '<div></div>'
        @doc = new Quill.Document(@container.firstChild, { formats: Quill.DEFAULTS.formats })
        @selection = new Quill.Selection(@doc, @emitter)
        index = @selection._positionToIndex(@doc.root, 0)
        expect(index).toEqual(0)
      )
    )


      it('empty document', ->
        @container.innerHTML = '<div></div>'
        quill = new Quill(@container.firstChild)
        [resultNode, resultIndex] = quill.editor.selection._normalizePosition(quill.editor.doc.root, 0)
        expect(resultNode).toEqual(quill.editor.doc.root)
        expect(resultIndex).toEqual(0)
      )
    )
