     overlayDOM
 
 fakePopover =
-  right: (popperElement) ->
-    popperElement.calcOverlayPosition = ->
+  right: (popper) ->
+    popper.calcOverlayPosition = ->
       overlayLeft: 100
 
-  left: (popperElement) ->
-    popperElement.calcOverlayPosition = ->
+  left: (popper) ->
+    popper.calcOverlayPosition = ->
       overlayLeft: 600
 
-  scrollHeight: (popperElement) ->
+  loadImages: (popper, overlay) ->
+    overlayDOM = popper.getOverlayDOMNode()
+    images = overlayDOM.getElementsByTagName('img')
+
+    _.each(images, (image) ->
+      image.complete = false
+      image.onload = null
+    )
+
+  scrollHeight: (popper) ->
     getOverlayDimensions = (calledOnce) ->
       height: if calledOnce then 500 else 800
       width: 500
 
-    fakeOverflow(popperElement, getOverlayDimensions)
-
-  scrollWidth: (popperElement) ->
+    fakeOverflow(popper, getOverlayDimensions)
+
+  scrollWidth: (popper) ->
     getOverlayDimensions = (calledOnce) ->
       width: if calledOnce then 500 else 900
       height: 500
 
-    fakeOverflow(popperElement, getOverlayDimensions)
-
-  scrollBoth: (popperElement) ->
+    fakeOverflow(popper, getOverlayDimensions)
+
+  scrollBoth: (popper) ->
     getOverlayDimensions = (calledOnce) ->
       width: if calledOnce then 500 else 900
       height: if calledOnce then 500 else 800
 
-    fakeOverflow(popperElement, getOverlayDimensions)
-
-fakePopoverShould = (fakeAs, popperElement, dom) ->
+    fakeOverflow(popper, getOverlayDimensions)
+
+fakePopoverShould = (fakeAs, dom, popper, overlay) ->
   Testing.actions.click(dom)
-  fakePopover[fakeAs]?(popperElement)
+  fakePopover[fakeAs]?(popper, overlay)
   Testing.actions.blur(dom)
 
 PopoverWrapper = React.createClass

        {overlay} = element.refs
        {popper} = overlay.refs
        popper.updateOverlayPosition = sinon.spy()

        Testing.actions.click(dom)
        overlayDOM = popper.getOverlayDOMNode()

        expect(overlayDOM.querySelector('.image-loading')).to.not.be.falsy
        expect(popper.updateOverlayPosition).to.have.been.calledOnce
        expect(overlay.state.firstShow).to.be.false
        expect(overlay.state.imagesLoading).to.deep.equal([true, true])


        # Image loading should still be set when only one of two images are loaded
        expect(overlay.state.imagesLoading).to.deep.equal([false, true])
        expect(overlayDOM.querySelector('.image-loading')).to.not.be.falsy
        expect(popper.updateOverlayPosition).to.have.been.calledThrice

  it 'should retrigger positioning and not have image-loading when all images loaded', ->
    Testing
