       .then ({dom, element}) ->
         {overlay} = element.refs
         {popper} = overlay.refs
-        fakePopoverShould('scrollWidth', popper, dom)
+        fakePopoverShould('scrollWidth', dom, popper)
         Testing.actions.click(dom)
         overlayDOM = popper.getOverlayDOMNode()
 

        # 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.calledTwice

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

      .then ({dom, element}) ->
        {overlay} = element.refs
        {popper} = overlay.refs
        fakePopoverShould('scrollBoth', dom, popper)
        Testing.actions.click(dom)
        overlayDOM = popper.getOverlayDOMNode()

