mirror of https://github.com/usbharu/Hideout.git
test: postのテストを追加
This commit is contained in:
parent
2c298d2d26
commit
f794095ecf
|
@ -143,6 +143,24 @@ class PostTest {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun ゔvisibilityがDIRECT以外の時visibleActorsを変更できない() {
|
||||||
|
val post = TestPostFactory.create(visibility = Visibility.FOLLOWERS)
|
||||||
|
|
||||||
|
post.visibleActors = setOf(ActorId(100))
|
||||||
|
assertEmpty(post)
|
||||||
|
|
||||||
|
val post2 = TestPostFactory.create(visibility = Visibility.UNLISTED)
|
||||||
|
|
||||||
|
post2.visibleActors = setOf(ActorId(100))
|
||||||
|
assertEmpty(post2)
|
||||||
|
|
||||||
|
val post3 = TestPostFactory.create(visibility = Visibility.PUBLIC)
|
||||||
|
|
||||||
|
post3.visibleActors = setOf(ActorId(100))
|
||||||
|
assertEmpty(post3)
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun visibilityがDIRECTの時visibleActorsを変更できる() {
|
fun visibilityがDIRECTの時visibleActorsを変更できる() {
|
||||||
val post = TestPostFactory.create(visibility = Visibility.DIRECT)
|
val post = TestPostFactory.create(visibility = Visibility.DIRECT)
|
||||||
|
@ -191,4 +209,6 @@ class PostTest {
|
||||||
post.content = PostContent("test", "test", emptyList())
|
post.content = PostContent("test", "test", emptyList())
|
||||||
assertContainsEvent(post, PostEvent.update.eventName)
|
assertContainsEvent(post, PostEvent.update.eventName)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue