QUnit.module('AssignListItemViewSpec - mastery paths link', {
  setup() {
    fakeENV.setup({
      current_user_roles: ['teacher'],
      CONDITIONAL_RELEASE_SERVICE_ENABLED: true,
      CONDITIONAL_RELEASE_ENV: {
        active_rules: [
          {
            trigger_assignment: '1',
            scoring_ranges: [{assignment_sets: [{assignments: [{assignment_id: '2'}]}]}]
          }
        ]
      },
      URLS: {assignment_sort_base_url: 'test'}
    })
    return CyoeHelper.reloadEnv()
  },
  teardown() {
    fakeENV.teardown()
  }
})

test('does not render for assignment if cyoe off', () => {
  ENV.CONDITIONAL_RELEASE_SERVICE_ENABLED = false
  const model = buildAssignment({
    id: '1',
    title: 'Foo',
    can_update: true,
    submission_types: ['online_text_entry']
  })
  const view = createView(model)
    this.ajaxStub = sandbox.stub($, 'ajaxJSON')
    fakeENV.setup({
      CONDITIONAL_RELEASE_ENV: {
        active_rules: [
          {
            trigger_assignment: '1',
            scoring_ranges: [
              {
                assignment_sets: [{assignments: [{assignment_id: '2'}]}]
              }
            ]
          }
        ]
      }
    })
    CyoeHelper.reloadEnv()
  },
  teardown() {
    fakeENV.teardown()
  }
})

test('it should be accessible', function(assert) {
  const quiz = new Quiz({id: 1, title: 'Foo', can_update: true})
  const view = createView(quiz)
  const done = assert.async()
  return assertions.isAccessible(view, done, {a11yReport: true})
})

test('renders admin if can_update', function() {
  const quiz = createQuiz({id: 1, title: 'Foo', can_update: true})
Пример #3
0
const setEnv = env => {
  fakeENV.setup(env)
  CyoeHelper.reloadEnv()
}