   beforeEach ->
     @props =
       collectionUUID: 'test-collection-uuid'
+    @course = new Course(STATUS.courses[0])
+    @sandbox = sinon.sandbox.create()
+    @sandbox.stub(User, 'getCourse').returns(@course)
+    @sandbox.stub(User, 'isLoggedIn').returns(true)
 
+  afterEach ->
+    @sandbox.restore()
 
   it 'renders new if course is new', ->
+    sinon.stub(@course, 'isRegistered').returns(false)
     Testing.renderComponent( Registration, props: @props ).then ({element}) ->
       expect(
         ReactTestUtils.scryRenderedComponentsWithType(element, NewCourseRegistration)



  it 'renders modify if course is already registered', ->
    course = new Course(STATUS.courses[0])
    sinon.stub(User, 'getCourse').returns(course)
    Testing.renderComponent( Registration, props: @props ).then ({element}) ->
      expect(
        ReactTestUtils.scryRenderedComponentsWithType(element, ModifyCourseRegistration)
      ).not.to.be.empty

STATUS = require '../../auth/status/GET'
User = require 'user/model'
Registration = require 'course/registration'
EnrollOrLogin = require 'course/enroll-or-login'
NewCourseRegistration = require 'course/new-registration'
ModifyCourseRegistration = require 'course/modify-registration'

