You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-**When `...` is on a line by itself in a code example it means that I hav not provided all of the code from that file. Please be careful to copy each section that is separated by `...`'s and use them in the appropriate part of your files.**
978
979
979
980
- This test checks to see if the jest [mock function](https://jestjs.io/docs/mock-functions) was called. In this test the note's name and description are blank so a new note should not be created and added to the list of notes.
980
981
- We have a failing test.
@@ -1757,4 +1758,69 @@ async function deleteNoteCallback( id ) {
1757
1758
1758
1759
[Code for this section](https://github.com/pairing4good/tdd-amplify-react/commit/c17100754bf3a9edfebfeb8219b87766fb1cde00)
1759
1760
1761
+
</details>
1762
+
1763
+
<details>
1764
+
<summary>Note List Component Testing</summary>
1765
+
1766
+
## Note List Component Testing
1767
+
Since we started at the top of the testing pyramid we need to make sure, once we are on green, that we work our way down to lower level tests too.
1768
+
1769
+
- Add a test to `NoteList.test.js` to verify the deletion behavior of the `NoteList` component.
- I added a mock function for the `deleteNoteCallback` and a `setup` function that has properties that can be overridden for specific test cases. This is a pattern that is often used in this style of tests.
0 commit comments