gitlab-org--gitlab-foss/spec/javascripts/notes_spec.js.coffee

27 lines
758 B
CoffeeScript
Raw Normal View History

2015-05-05 03:06:57 +00:00
#= require notes
#= require gl_form
2015-05-05 03:06:57 +00:00
window.gon or= {}
2015-05-05 03:06:57 +00:00
window.disableButtonIfEmptyField = -> null
describe 'Notes', ->
describe 'task lists', ->
fixture.preload('issue_note.html')
2015-05-05 03:06:57 +00:00
beforeEach ->
fixture.load('issue_note.html')
$('form').on 'submit', (e) -> e.preventDefault()
2015-05-05 03:06:57 +00:00
@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')
2015-05-05 03:06:57 +00: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)