Find notes by tags
This commit is contained in:
@@ -155,6 +155,27 @@ internal class NoteRepositoryImplTest {
|
||||
.hasSize(10)
|
||||
.allMatch { it.title.toInt() in 41..50 }
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `find all notes with tag`() {
|
||||
createNote(user1.id, "1", listOf("a", "b"))
|
||||
createNote(user1.id, "2")
|
||||
createNote(user1.id, "3", listOf("c"))
|
||||
createNote(user1.id, "4", listOf("c"))
|
||||
createNote(user2.id, "5", listOf("c"))
|
||||
|
||||
assertThat(noteRepo.findAll(user1.id, tag = "a"))
|
||||
.hasSize(1)
|
||||
.first()
|
||||
.hasFieldOrPropertyWithValue("title", "1")
|
||||
|
||||
assertThat(noteRepo.findAll(user1.id, tag = "c"))
|
||||
.hasSize(2)
|
||||
|
||||
assertThat(noteRepo.findAll(user2.id, tag = "c"))
|
||||
.hasSize(1)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Nested
|
||||
|
||||
Reference in New Issue
Block a user