@@ -1710,6 +1710,7 @@ sends the `signal('DELETE', todo.id, model)`
1710
1710
+ [ ] The ` DELETE ` update case receives the ` todo.id `
1711
1711
and removes it from the ` model.todos ` Array.
1712
1712
1713
+ <!-- I don't think we need this!
1713
1714
In order to `DELETE` an item from the `model.todos` Array,
1714
1715
we need to "_supply_" the `model` when invoking the `signal`
1715
1716
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
1749
1750
after making the change to the `signal` function. (_they should!_)
1750
1751
1751
1752

1752
-
1753
+ -->
1753
1754
1754
1755
##### ` DELETE ` Item _ Test_
1755
1756
@@ -1818,31 +1819,52 @@ There is no "right" answer, there are at least
1818
1819
5 ways of solving this, as always, you should write the code
1819
1820
that you feel is most _ readable_ .
1820
1821
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.
1821
1825
1822
1826
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.
1830
1830
1831
1831
```
1832
1832
should allow me to edit an item
1833
1833
```
1834
1834
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
+
1835
1842
Editing a Todo List item is (_ by far_ )
1836
1843
the most "complex" functionality in the TodoMVC app
1837
1844
because it involves multiple steps and "dynamic UI".
1838
1845
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
+ ```
1839
1857
1840
1858
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_ ** "
1843
1863
(_ 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_ ** ",
1846
1868
get the text value from the ** ` <input class="edit"> ` **
1847
1869
_ instead_ of ** ` <input id="new-todo"> ` **
1848
1870
so that we _ update_ the _ existing_ Todo Item title (text).
@@ -1911,7 +1933,7 @@ function render_item (item, signal) {
1911
1933
}
1912
1934
```
1913
1935
1914
-
1936
+ <!--
1915
1937
## What _Next_?
1916
1938
1917
1939
If you feel _confident_ with your "TEA" skills you can _either_:
0 commit comments