-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
58 additions
and
49 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 0 additions & 31 deletions
31
presentation/src/androidTest/java/com/alexmumo/presentation/detail/DetailScreenTest.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
presentation/src/test/java/com/alexmumo/presentation/detail/DetailScreenTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package com.alexmumo.presentation.detail | ||
|
||
import androidx.compose.ui.test.junit4.createComposeRule | ||
import androidx.compose.ui.test.onNodeWithTag | ||
import androidx.navigation.compose.rememberNavController | ||
import com.alexmumo.domain.model.Article | ||
import com.alexmumo.domain.model.Source | ||
import com.alexmumo.domain.repository.BookMarkRepository | ||
import com.alexmumo.presentation.bookmarks.BookMarkViewModel | ||
import io.mockk.mockk | ||
import org.junit.Before | ||
import org.junit.Rule | ||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
import org.robolectric.RobolectricTestRunner | ||
import org.robolectric.annotation.Config | ||
import org.robolectric.shadows.ShadowLog | ||
|
||
|
||
@RunWith(RobolectricTestRunner::class) | ||
@Config(instrumentedPackages = ["androidx.loader.content"], sdk = [33]) | ||
class DetailScreenTest { | ||
@get:Rule | ||
val composeRule = createComposeRule() | ||
|
||
private val bookMarkRepository = mockk<BookMarkRepository>(relaxed = true) | ||
private val viewModel = BookMarkViewModel(bookMarkRepository = bookMarkRepository) | ||
|
||
@Before | ||
@Throws(Exception::class) | ||
fun setUp() { | ||
ShadowLog.stream = System.out | ||
} | ||
|
||
@Test | ||
fun testDetailLayout() { | ||
composeRule.setContent { | ||
DetailScreen(navController = rememberNavController(), viewModel = viewModel, article = Article(author = null, content = null,description = null,publishedAt = null, Source(id = null, name = ""),title = null, url = "", urlToImage = null )) | ||
} | ||
composeRule.onNodeWithTag("detail_tag").assertExists() | ||
} | ||
} |
4 changes: 2 additions & 2 deletions
4
...xmumo/presentation/home/HomeScreenTest.kt → ...xmumo/presentation/home/HomeScreenTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
package com.alexmumo.presentation.home | ||
|
||
class HomeScreenTest { | ||
|
||
} | ||
|
||
class HomeScreenTest |
7 changes: 0 additions & 7 deletions
7
presentation/src/test/java/com/alexmumo/presentation/home/HomeViewModelTest.kt
This file was deleted.
Oops, something went wrong.