2015-05-04 23:06:57 -04:00
|
|
|
#= require notes
|
2016-04-05 08:23:43 -04:00
|
|
|
#= require gl_form
|
2015-05-04 23:06:57 -04:00
|
|
|
|
|
|
|
window.gon = {}
|
|
|
|
window.disableButtonIfEmptyField = -> null
|
|
|
|
|
|
|
|
describe 'Notes', ->
|
|
|
|
describe 'task lists', ->
|
2015-05-06 16:54:34 -04:00
|
|
|
fixture.preload('issue_note.html')
|
2015-05-04 23:06:57 -04:00
|
|
|
|
|
|
|
beforeEach ->
|
2015-05-06 16:54:34 -04:00
|
|
|
fixture.load('issue_note.html')
|
|
|
|
$('form').on 'submit', (e) -> e.preventDefault()
|
2015-05-04 23:06:57 -04:00
|
|
|
|
|
|
|
@notes = new Notes()
|
|
|
|
|
2015-05-06 16:54:34 -04:00
|
|
|
it 'modifies the Markdown field', ->
|
|
|
|
$('input[type=checkbox]').attr('checked', true).trigger('change')
|
|
|
|
expect($('.js-task-list-field').val()).toBe('- [x] Task List Item')
|
|
|
|
|
2015-05-04 23:06:57 -04:00
|
|
|
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)
|