 
 {TimeActions, TimeStore} = require '../../../src/flux/time'
 {PlanPublishStore, PlanPublishActions} = require '../../../src/flux/plan-publish'
+{JobStore, JobActions} = require '../../../src/flux/job'
 
 Plan = require '../../../src/components/course-calendar/plan'
 

  it 'should show as published when plan is done publishing', ->
    item = _.clone(ITEM_DRAFT_ONE_DAY)
    item.plan = fakePublishing(item.plan)
    item.plan.is_publishing = false
    item.plan.is_published = true
    succeededProgress =
      for: item.plan.id
      id: JOB_UUID
      status: 'succeeded'

    Testing
      .renderComponent( ContainedPlan, props: {courseId: PLAN_COURSE_ID, item} )


        checkChildrenComponents(element.refs.plan, item, checksForIsPublishing)

        checksIsPublished =
          display: (components, {display}) ->
            displayNode = components.displayComponent.getDOMNode()
            expect(displayNode.classList.contains('is-published')).to.be.true

        checker = _.partial(checkChildrenComponents, element.refs.plan, item, checksIsPublished)
        PlanPublishStore.on("progress.#{item.plan.id}.*", checker)
  
        fakePublished(item.plan)

  it 'should check for publishing subscribe if plan isPublishing props update', ->
    item = _.clone(ITEM_DRAFT_ONE_DAY)
    item.plan = fakePublishing(item.plan)
    item.plan.isPublishing = true

    Testing
      .renderComponent( ContainedPlan, props: {courseId: PLAN_COURSE_ID, item: ITEM_DRAFT_ONE_DAY} )
