BigW Consortium Gitlab

notes_spec.js.coffee 756 Bytes
Newer Older
1
#= require notes
2
#= require gl_form
3 4 5 6 7 8

window.gon = {}
window.disableButtonIfEmptyField = -> null

describe 'Notes', ->
  describe 'task lists', ->
9
    fixture.preload('issue_note.html')
10 11

    beforeEach ->
12 13
      fixture.load('issue_note.html')
      $('form').on 'submit', (e) -> e.preventDefault()
14 15 16

      @notes = new Notes()

17 18 19 20
    it 'modifies the Markdown field', ->
      $('input[type=checkbox]').attr('checked', true).trigger('change')
      expect($('.js-task-list-field').val()).toBe('- [x] Task List Item')

21 22 23 24 25 26
    it 'submits the form on tasklist:changed', ->
      submitted = false
      $('form').on 'submit', (e) -> submitted = true; e.preventDefault()

      $('.js-task-list-field').trigger('tasklist:changed')
      expect(submitted).toBe(true)