Skip to content

Commit ee2ef67

Browse files
committed
test(ui): tdd for 'it should allow the deletion of an item'
1 parent 6683cd3 commit ee2ef67

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/main/webapp/src/app.test.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ class TodosPage {
2626
this.todoItemIsChecked = (idx) => {
2727
return Selector(`ul.todo-list > li:nth-child(${idx}) input[type=checkbox].toggle:checked`).exists
2828
}
29+
30+
this.deleteTodoItemButton = (idx) => {
31+
return Selector(`ul.todo-list > li:nth-child(${idx}) > div > button.destroy`)
32+
}
2933
}
3034
}
3135

@@ -120,4 +124,12 @@ test('should allow marking all items as completed', async t => {
120124
test('should correctly update the complete all checked state', async t => {
121125
await t
122126
.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);
123135
});

0 commit comments

Comments
 (0)