@@ -20,19 +20,34 @@ module "TaskList updates",
2020 disabled : true
2121 checked : false
2222
23+ @incompleteNBSPItem = $ ' <li>' , class : ' task-list-item'
24+ @incompleteNBSPCheckbox = $ ' <input>' ,
25+ type : ' checkbox'
26+ class : ' task-list-item-checkbox'
27+ disabled : true
28+ checked : false
29+
2330 @field = $ ' <textarea>' , class : ' js-task-list-field' , text : """
2431 - [x] complete
2532 - [ ] incomplete
33+ - [\x C2\x A0] incompleteNBSP
2634 """
2735
2836 @changes =
2937 toComplete : """
3038 - [ ] complete
3139 - [ ] incomplete
40+ - [\x C2\x A0] incompleteNBSP
3241 """
3342 toIncomplete : """
3443 - [x] complete
3544 - [x] incomplete
45+ - [\x C2\x A0] incompleteNBSP
46+ """
47+ toIncompleteNBSP : """
48+ - [x] complete
49+ - [ ] incomplete
50+ - [x] incompleteNBSP
3651 """
3752
3853 @completeItem .append @completeCheckbox
@@ -43,6 +58,10 @@ module "TaskList updates",
4358 @list .append @incompleteItem
4459 @incompleteItem .expectedIndex = 2
4560
61+ @incompleteNBSPItem .append @incompleteNBSPCheckbox
62+ @list .append @incompleteNBSPItem
63+ @incompleteNBSPItem .expectedIndex = 3
64+
4665 @container .append @list
4766 @container .append @field
4867
@@ -79,3 +98,17 @@ asyncTest "updates the source, marking the complete item as incomplete", ->
7998 , 20
8099
81100 @completeCheckbox .click ()
101+
102+ asyncTest " updates the source for items with non-breaking spaces" , ->
103+ expect 3
104+
105+ @field .on ' tasklist:changed' , (event , index , checked ) =>
106+ ok checked
107+ equal index, @incompleteNBSPItem .expectedIndex
108+ equal @field .val (), @changes .toIncompleteNBSP
109+
110+ setTimeout ->
111+ start ()
112+ , 20
113+
114+ @incompleteNBSPCheckbox .click ()
0 commit comments