Skip to content
This repository was archived by the owner on Nov 1, 2017. It is now read-only.

Commit 527c83d

Browse files
committed
Test enabled event
1 parent 247f9d7 commit 527c83d

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

test/unit/test_task_lists.coffee

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ module "TaskLists",
2525
$('#qunit-fixture').append(@container).pageUpdate()
2626

2727
teardown: ->
28+
$(document).off 'tasklist:enabled'
29+
$(document).off 'tasklist:disabled'
30+
$(document).off 'tasklist:change'
2831

2932
asyncTest "triggers a tasklist:change event on task list item changes", ->
3033
expect 1
@@ -37,3 +40,27 @@ asyncTest "triggers a tasklist:change event on task list item changes", ->
3740
, 20
3841

3942
@checkbox.click()
43+
44+
asyncTest "enables task list items when a .js-task-list-field is present", ->
45+
expect 1
46+
47+
$(document).on 'tasklist:enabled', (event) ->
48+
ok true
49+
50+
@container.pageUpdate()
51+
setTimeout ->
52+
start()
53+
, 20
54+
55+
asyncTest "doesn't enable task list items when a .js-task-list-field is absent", ->
56+
expect 0
57+
58+
$(document).on 'tasklist:enabled', (event) ->
59+
ok true
60+
61+
@field.remove()
62+
63+
@container.pageUpdate()
64+
setTimeout ->
65+
start()
66+
, 20

0 commit comments

Comments
 (0)