summaryrefslogtreecommitdiff
path: root/spec/javascripts/notes_spec.js.coffee
blob: 050b6e362c65d19efec6d698570d9b267e8e1586 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#= require notes

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

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

    beforeEach ->
      fixture.load('issue_note.html')
      $('form').on 'submit', (e) -> e.preventDefault()

      @notes = new Notes()

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

    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)