 
   renderComponent: (component, options = {}) ->
     options.props ||= {}
+    CURRENT_ROUTER_PARAMS = options.routerParams or {}
     root = document.createElement('div')
     promise = new Promise( (resolve, reject) ->
       props = _.clone(options.props)

    # defer adding the then callback so it'll be called after whatever is attached after the return
    _.defer -> promise.then ->
      React.unmountComponentAtNode(root)
      return arguments
    promise


{commonActions} = require './utilities'
sandbox = null
ROUTER = null
CURRENT_ROUTER_PARAMS = null
# Mock a router for the context
beforeEach ->
  sandbox = sinon.sandbox.create()
  ROUTER  = sandbox.spy()
  ROUTER.makeHref = sandbox.spy()
  ROUTER.transitionTo = sandbox.spy()
  ROUTER.getCurrentParams = sandbox.spy( -> CURRENT_ROUTER_PARAMS )
afterEach ->
  sandbox.restore()

