diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-05-29 09:10:46 +0000 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-05-29 09:10:46 +0000 |
commit | acb7721fe807a75860f4be0a3bb50146232fa229 (patch) | |
tree | e4d5d3eaf5102b6ac9770bc42d44a058143a8d47 /spec/javascripts/notes_spec.js.coffee | |
parent | ac584d6b086691ad6b496c082a80bc78b8f08a22 (diff) | |
parent | bd12ca5eb3c8b6ca9de28cbbb074ff1e29c661f2 (diff) | |
download | gitlab-ce-acb7721fe807a75860f4be0a3bb50146232fa229.tar.gz |
Merge branch 'rs-teaspoon' into 'master'
Add Teaspoon for Javascript testing
Looking to expand our Javascript unit tests, and this gem makes things a bit better in that respect.
See https://github.com/modeset/teaspoon
See merge request !715
Diffstat (limited to 'spec/javascripts/notes_spec.js.coffee')
-rw-r--r-- | spec/javascripts/notes_spec.js.coffee | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/spec/javascripts/notes_spec.js.coffee b/spec/javascripts/notes_spec.js.coffee index de2e8e7f6c8..050b6e362c6 100644 --- a/spec/javascripts/notes_spec.js.coffee +++ b/spec/javascripts/notes_spec.js.coffee @@ -1,5 +1,3 @@ -#= require jquery -#= require jasmine-fixture #= require notes window.gon = {} @@ -7,21 +5,18 @@ window.disableButtonIfEmptyField = -> null describe 'Notes', -> describe 'task lists', -> - selectors = { - container: 'li.note .js-task-list-container' - item: '.note-text ul.task-list li.task-list-item input.task-list-item-checkbox[type=checkbox] {Task List Item}' - textarea: '.note-edit-form form textarea.js-task-list-field{- [ ] Task List Item}' - } + fixture.preload('issue_note.html') beforeEach -> - $container = affix(selectors.container) - - # These two elements are siblings inside the container - $container.find('.js-task-list-container').append(affix(selectors.item)) - $container.find('.js-task-list-container').append(affix(selectors.textarea)) + 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() |