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

Commit 2b8c919

Browse files
committed
Set expected indexes explicitly
1 parent c34567e commit 2b8c919

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

test/unit/test_updates.coffee

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,11 @@ module "TaskList updates",
4141

4242
@completeItem.append @completeCheckbox
4343
@list.append @completeItem
44+
@completeItem.expectedIndex = 1
4445

4546
@incompleteItem.append @incompleteCheckbox
4647
@list.append @incompleteItem
48+
@incompleteItem.expectedIndex = 2
4749

4850
@container.append @list
4951
@container.append @field
@@ -57,8 +59,8 @@ asyncTest "updates the source, marking the incomplete item as complete", ->
5759
expect 3
5860

5961
@field.on 'tasklist:change', (event, index, checked) =>
60-
equal parseInt(@incompleteCheckbox.attr('data-item-index')), index
6162
ok checked
63+
equal index, @incompleteItem.expectedIndex
6264
equal @field.val(), @changes.toIncomplete
6365

6466
setTimeout ->
@@ -71,8 +73,8 @@ asyncTest "updates the source, marking the complete item as incomplete", ->
7173
expect 3
7274

7375
@field.on 'tasklist:change', (event, index, checked) =>
74-
equal parseInt(@completeCheckbox.attr('data-item-index')), index
7576
ok !checked
77+
equal index, @completeItem.expectedIndex
7678
equal @field.val(), @changes.toComplete
7779

7880
setTimeout ->

0 commit comments

Comments
 (0)