File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,10 @@ class TodosPage {
26
26
this . todoItemIsChecked = ( idx ) => {
27
27
return Selector ( `ul.todo-list > li:nth-child(${ idx } ) input[type=checkbox].toggle:checked` ) . exists
28
28
}
29
+
30
+ this . deleteTodoItemButton = ( idx ) => {
31
+ return Selector ( `ul.todo-list > li:nth-child(${ idx } ) > div > button.destroy` )
32
+ }
29
33
}
30
34
}
31
35
@@ -120,4 +124,12 @@ test('should allow marking all items as completed', async t => {
120
124
test ( 'should correctly update the complete all checked state' , async t => {
121
125
await t
122
126
. expect ( page . toggleAllIsChecked . exists ) . ok ( ) ;
127
+ } ) ;
128
+
129
+ test ( 'should allow the deletion of an item' , async t => {
130
+ await t
131
+ . expect ( page . itemCount ( ) ) . eql ( 3 )
132
+ . hover ( page . todoItem ( 1 ) )
133
+ . click ( page . deleteTodoItemButton ( 1 ) )
134
+ . expect ( page . itemCount ( ) ) . eql ( 2 ) ;
123
135
} ) ;
You can’t perform that action at this time.
0 commit comments