 TEST_LINK_TEXT = 'This is the link text.'
 TEST_HTML = '<p>This is the test HTML</p>
   <img src="https://cloud.githubusercontent.com/assets/2483873/9750887/734d9108-5663-11e5-9a1b-b4d10ffecb6d.png">'
+FAKE_WINDOW =
+  innerHeight: 600
+  innerWidth: 800
 
 checkDoesOverlayHTMLMatch = (overlayElement, html) ->
   popcontentDOM = overlayElement.refs.popcontent.getDOMNode()

        expect(overlay.state.show).to.be.false

  it 'should open to the right when element renders left of the window middle', ->
    window = {}

    Testing
      .renderComponent( PopoverWrapper )
      .then ({dom, element}) ->
        {overlay} = element.refs
        {popper} = overlay.refs
        fakePopoverShouldRight(popper, window)
        Testing.actions.click(dom)
        overlayDOM = popper.getOverlayDOMNode()


  expect(popcontentDOM.innerHTML).to.equal(html)
  expect(overlayDOM.innerHTML).to.contain(html)

fakePopoverShouldRight = (popperElement) ->
  popperElement.calcOverlayPosition = ->
    overlayLeft: 100

fakePopoverShouldLeft = (popperElement) ->
  popperElement.calcOverlayPosition = ->
    overlayLeft: 600

fakePopoverShouldScroll = (popperElement) ->
  calledOnce = false

  getOverlayDOMNode = popperElement.getOverlayDOMNode
  popperElement.getOverlayDOMNode = ->
