 
 {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 full modal if re-publishing', ->
    item = _.clone(ITEM_PUBLISHED_THREE_DAYS)
    item.plan = fakePublishing(item.plan)
    item.plan.is_published = true
    item.plan.is_publishing = false
    Testing
      .renderComponent( ContainedPlan, props: {courseId: PLAN_COURSE_ID, item} )
      .then ({dom, element, root}) ->

  publishingPlan.publish_last_requested_at = moment(TimeStore.getNow())
  publishingPlan.publish_job = {id: JOB_UUID, status: 'queued'}
  publishingPlan.is_publishing = true

  publishingPlan

fakePublished = (plan) ->
  succeededProgress =
    for: plan.id
    id: JOB_UUID
    status: 'succeeded'

  JobActions.loaded(succeededProgress, succeededProgress.id)
  JobStore.emit("job.#{succeededProgress.id}.final", succeededProgress)

checkChildrenComponents = (planComponent, item, checks) ->
  {plan, displays} = item
