Skip to content

Commit a597688

Browse files
committed
add acceptance criteria and checklist of features for EDIT todo item #60
1 parent 39ed374 commit a597688

File tree

1 file changed

+35
-13
lines changed

1 file changed

+35
-13
lines changed

Diff for: todo-list.md

+35-13
Original file line numberDiff line numberDiff line change
@@ -1710,6 +1710,7 @@ sends the `signal('DELETE', todo.id, model)`
17101710
+ [ ] The `DELETE` update case receives the `todo.id`
17111711
and removes it from the `model.todos` Array.
17121712

1713+
<!-- I don't think we need this!
17131714
In order to `DELETE` an item from the `model.todos` Array,
17141715
we need to "_supply_" the `model` when invoking the `signal`
17151716
function. This means we need to _extend_ the `signal` function's
@@ -1749,7 +1750,7 @@ Run the tests: `npm test` and ensure they all still pass
17491750
after making the change to the `signal` function. (_they should!_)
17501751
17511752
![tests-still-passing](https://user-images.githubusercontent.com/194400/44953303-a109ce00-ae93-11e8-8f0c-c271832df3a5.png)
1752-
1753+
-->
17531754

17541755
##### `DELETE` Item _Test_
17551756

@@ -1818,31 +1819,52 @@ There is no "right" answer, there are at least
18181819
5 ways of solving this, as always, you should write the code
18191820
that you feel is most _readable_.
18201821

1822+
If you get "_stuck_" or want to confirm your understanding
1823+
of the implementation of the `DELETE` functionality,
1824+
check the code in `todo-app.js` > `update` function.
18211825

18221826

1823-
1824-
1825-
1826-
<!--
1827-
1828-
1829-
#### 4.2 `EDIT` an Item
1827+
> Rather bizarrely the edit functionality is mentioned
1828+
_both_ in the Item and Editing sections.
1829+
So we will cover it in the Editing section next.
18301830

18311831
```
18321832
should allow me to edit an item
18331833
```
18341834

1835+
This is kinda _meaningless_ as an assertion.
1836+
What does "edit an item" actually _mean_?
1837+
(_we have expanded the acceptance criteria below..._)
1838+
1839+
1840+
### 5 `EDIT` an Item
1841+
18351842
Editing a Todo List item is (_by far_)
18361843
the most "complex" functionality in the TodoMVC app
18371844
because it involves multiple steps and "dynamic UI".
18381845

1846+
#### `EDIT` Item Test Titles & Acceptance Criteria
1847+
1848+
```
1849+
5. Editing
1850+
✓ should hide other controls when editing (718ms)
1851+
✓ should save edits on enter (1093ms)
1852+
✓ should save edits on blur (1256ms)
1853+
✓ should trim entered text (1163ms)
1854+
✓ should remove the item if an empty text string was entered (1033ms)
1855+
✓ should cancel edits on escape (1115ms)
1856+
```
18391857

18401858

1841-
+ [ ] Double-click on Item **`<label>title</label>`** to begin editing.
1842-
+ [ ] Render an **`<input class="edit">`** if in "**editing _mode_**"
1859+
+ [ ] Double-click on Item **`<label>title</label>`**
1860+
to begin editing.
1861+
+ [ ] Render an **`<input class="edit">`**
1862+
if in "**editing _mode_**"
18431863
(_see screenshot and markup below_)
1844-
+ [ ] Add `case` in `keyup` Event Listener for **`[Enter]`** keyup
1845-
(_see **`subscriptions`** above_) if we are in "**editing _mode_**",
1864+
+ [ ] Add `case` in `keyup` Event Listener
1865+
for **`[Enter]`** keyup
1866+
(_see **`subscriptions`** above_) if we are
1867+
in "**editing _mode_**",
18461868
get the text value from the **`<input class="edit">`**
18471869
_instead_ of **`<input id="new-todo">`**
18481870
so that we _update_ the _existing_ Todo Item title (text).
@@ -1911,7 +1933,7 @@ function render_item (item, signal) {
19111933
}
19121934
```
19131935

1914-
1936+
<!--
19151937
## What _Next_?
19161938
19171939
If you feel _confident_ with your "TEA" skills you can _either_:

0 commit comments

Comments
 (0)