@@ -719,6 +719,78 @@ and _just_ focus on rendering the _list_ itself.
719
719
![ todomvc-3-items-1-done] ( https://user-images.githubusercontent.com/194400/43690122-b72bcb0e-98fc-11e8-83c2-8b8703b177ed.png )
720
720
721
721
722
+ In your web browser, open ** Dev** eloper ** Tools**
723
+ and _ inspect_ the HTML for the Todo list:
724
+
725
+ ![ todomvc-main-section-todo-list-html] ( https://user-images.githubusercontent.com/194400/43717480-9fb80982-997f-11e8-9ffe-6aa90a89a042.png )
726
+
727
+ This is the HTML copied directly from the browser:
728
+ ``` html
729
+ <section class =" main" style =" display : block ;" >
730
+ <input class =" toggle-all" type =" checkbox" >
731
+ <label for =" toggle-all" >Mark all as complete</label >
732
+ <ul class =" todo-list" >
733
+ <li data-id =" 1533501855500" class =" completed" >
734
+ <div class =" view" >
735
+ <input class =" toggle" type =" checkbox" >
736
+ <label >Learn Elm Architecture</label >
737
+ <button class =" destroy" ></button >
738
+ </div >
739
+ </li >
740
+ <li data-id =" 1533501861171" class =" " >
741
+ <div class =" view" >
742
+ <input class =" toggle" type =" checkbox" >
743
+ <label >Build Todo List App</label >
744
+ <button class =" destroy" ></button >
745
+ </div >
746
+ </li >
747
+ <li data-id =" 1533501867123" class =" " >
748
+ <div class =" view" ><input class =" toggle" type =" checkbox" >
749
+ <label >Win the Internet!</label >
750
+ <button class =" destroy" ></button >
751
+ </div >
752
+ </li >
753
+ </ul >
754
+ </section >
755
+ ```
756
+ > _ ** Note** : there is "redundant" markup in this HTML in the form of a ` <div> `
757
+ inside the `<li> `, for now we are just replicating the HTML "faithfully",
758
+ we can "prune" it later._
759
+
760
+ From this HTMl we can write our
761
+ [ "** _ Technical_ Acceptance Criteria** "] ( https://github.com/dwyl/learn-elm-architecture-in-javascript/issues/51 ) :
762
+
763
+ + [ ] Todo List items should be displayed as list items ** ` <li> ` **
764
+ in an _ unordered list_ ** ` <ul> ` ** .
765
+ + [ ] Each Todo List item ** ` <li> ` ** should contain a ** ` <div> ` **
766
+ with a ** ` class="view" ` ** which "wraps":
767
+ + [ ] ** ` <input class="toggle" type="checkbox"> ` ** - the "checkbox"
768
+ that people can "Toggle" to change the "state"
769
+ of the Todo item from "active" to "done"
770
+ (_ which updates the model
771
+ From: ` model.todos[id].done=false `
772
+ To: ` model.todos[id].done=true ` _ )
773
+ + [ ] ** ` <label> ` ** - the text content of the todo list item
774
+ + [ ] ** ` <button class="destroy"> ` ** - the button the person
775
+ can click/tap to ** ` delete ` ** a Todo item.
776
+
777
+
778
+ ### Todo List ` view ` Test Assertions
779
+
780
+ Given the ` model ` (_ above_ ),
781
+ + [ ] There is a ` <ul class="todo-list"> ` with 3 ** ` <li> ` ** (_ list items_ )
782
+ rendered in the ` view ` .
783
+ + [ ] The *** first*** ** ` <li> ` ** has an ** ` <input type="checkbox"> ` **
784
+ which is _ checked_ (` done=true ` )
785
+ + [ ] The *** remaining*** ** ` <li>'s ` ** have ** ` <input type="checkbox"> ` **
786
+ that are _ unchecked_ (` done=false ` )
787
+
788
+
789
+ We can _ easily_ write a _ test_ that includes these 3 assertions:
790
+
791
+
792
+
793
+
722
794
723
795
<!--
724
796
0 commit comments