@@ -614,15 +614,15 @@ test('notes are returned as json', async () => {
614
614
})
615
615
616
616
test (' all notes are returned' , async () => {
617
- const notes = await helper . notesInDb () // highlight-line
617
+ const response = await api . get ( ' /api/notes ' )
618
618
619
- assert .strictEqual (notes .length , helper .initialNotes .length ) // highlight-line
619
+ assert .strictEqual (response . body .length , helper .initialNotes .length ) // highlight-line
620
620
})
621
621
622
622
test (' a specific note is within the returned notes' , async () => {
623
- const notes = await helper . notesInDb () // highlight-line
623
+ const response = await api . get ( ' /api/notes ' )
624
624
625
- const contents = notes . map (n => n .content )
625
+ const contents = response . body . map (e => e .content )
626
626
assert (contents .includes (' HTML is easy' ))
627
627
})
628
628
@@ -1078,15 +1078,15 @@ describe('when there is initially some notes saved', () => {
1078
1078
})
1079
1079
1080
1080
test (' all notes are returned' , async () => {
1081
- const notes = await helper . notesInDb ( )
1081
+ const response = await api . get ( ' /api/notes ' )
1082
1082
1083
- assert .strictEqual (notes .length , helper .initialNotes .length )
1083
+ assert .strictEqual (response . body .length , helper .initialNotes .length )
1084
1084
})
1085
1085
1086
1086
test (' a specific note is within the returned notes' , async () => {
1087
- const notes = await helper . notesInDb ( )
1087
+ const response = await api . get ( ' /api/notes ' )
1088
1088
1089
- const contents = notes . map (n => n .content )
1089
+ const contents = response . body . map (e => e .content )
1090
1090
assert (contents .includes (' HTML is easy' ))
1091
1091
})
1092
1092
0 commit comments