         expect(overlayDOM.classList.contains('right')).to.be.true
 
   it 'should open to the left when element renders right of the window middle', ->
-    window = {}
+    window = _.clone(FAKE_WINDOW)
 
     Testing
       .renderComponent( PopoverWrapper )
       .then ({dom, element}) ->
         {overlay} = element.refs
         {popper} = overlay.refs
-        fakePopoverShouldLeft(popper, window)
+        fakePopoverShouldLeft(popper)
         Testing.actions.click(dom)
         overlayDOM = popper.getOverlayDOMNode()
 

        expect(overlayDOM.style.cssText).to.not.contain('height')

  it 'should set overlay height and be scrollable if overlay height is greater than window height', ->
    window = {}

    Testing
      .renderComponent( PopoverWrapper )
      .then ({dom, element}) ->
        {overlay} = element.refs
        {popper} = overlay.refs

        Testing.actions.click(dom)
        fakePopoverShouldScroll(popper, window)
        overlayDOM = popper.getOverlayDOMNode()

        expect(overlayDOM.style.cssText).to.contain('height')

      calledOnce = true
      rect
    overlayDOM

PopoverWrapper = React.createClass
  displayName: 'PopoverWrapper'
