Skip to content

Commit 7e00f8c

Browse files
committed
fix test
1 parent baa9c29 commit 7e00f8c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

app/src/test/java/com/codingwithmitch/openapi/interactors/blog/IsAuthorOfBlogPostTest.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import java.net.HttpURLConnection
2222

2323
/**
2424
* 1. Success (They are the author)
25-
* 2. Failure (They are not the author)
25+
* 2. Success (They are not the author)
2626
* 3. Failure (AuthToken is null)
2727
* 4. Failure (Some random error)
2828
*/
@@ -87,7 +87,7 @@ class IsAuthorOfBlogPostTest {
8787
}
8888

8989
@Test
90-
fun failure_notTheAuthor() = runBlocking {
90+
fun success_notTheAuthor() = runBlocking {
9191
// condition the response
9292
mockWebServer.enqueue(
9393
MockResponse()
@@ -109,11 +109,11 @@ class IsAuthorOfBlogPostTest {
109109
// first emission should be `loading`
110110
assert(emissions[0].isLoading)
111111

112-
// confirm second emission is boolean with error dialog
112+
// confirm second emission is boolean with success message
113113
assert(emissions[1].data == false)
114114
assert(emissions[1].stateMessage?.response?.message == ErrorHandling.ERROR_EDIT_BLOG_NEED_PERMISSION)
115-
assert(emissions[1].stateMessage?.response?.uiComponentType is UIComponentType.Dialog)
116-
assert(emissions[1].stateMessage?.response?.messageType is MessageType.Error)
115+
assert(emissions[1].stateMessage?.response?.uiComponentType is UIComponentType.None)
116+
assert(emissions[1].stateMessage?.response?.messageType is MessageType.Success)
117117

118118

119119
// loading done

0 commit comments

Comments
 (0)