Skip to content

Commit 2a459d7

Browse files
authored
Merge pull request #4214 from AbelGAlem/test-delete-assert-by-id
Improve delete note test: assert removal by id (not content)
2 parents cc12fab + 04b7122 commit 2a459d7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/content/4/en/part4b.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -794,8 +794,8 @@ test('a note can be deleted', async () => {
794794

795795
const notesAtEnd = await helper.notesInDb()
796796

797-
const contents = notesAtEnd.map(n => n.content)
798-
assert(!contents.includes(noteToDelete.content))
797+
const ids = notesAtEnd.map(n => n.id)
798+
assert(!ids.includes(noteToDelete.id))
799799

800800
assert.strictEqual(notesAtEnd.length, helper.initialNotes.length - 1)
801801
})
@@ -1087,8 +1087,8 @@ describe('when there is initially some notes saved', () => {
10871087

10881088
const notesAtEnd = await helper.notesInDb()
10891089

1090-
const contents = notesAtEnd.map(n => n.content)
1091-
assert(!contents.includes(noteToDelete.content))
1090+
const ids = notesAtEnd.map(n => n.id)
1091+
assert(!ids.includes(noteToDelete.id))
10921092

10931093
assert.strictEqual(notesAtEnd.length, helper.initialNotes.length - 1)
10941094
})

0 commit comments

Comments
 (0)