Skip to content

Commit

Permalink
Add detail screen test
Browse files Browse the repository at this point in the history
  • Loading branch information
alexymumo committed Mar 17, 2024
1 parent 599ed15 commit 4a0a352
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 3 deletions.
13 changes: 13 additions & 0 deletions .idea/androidTestResultsUserPreferences.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions .idea/deploymentTargetDropDown.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.alexmumo.presentation.data

import com.alexmumo.domain.model.Article
import com.alexmumo.domain.model.Source

val article = Article(
author = null,
content = null,
description = null,
publishedAt = null,
source = Source(
id = null,
name = ""
),
title = null,
url = "",
urlToImage = null
)
Original file line number Diff line number Diff line change
@@ -1,20 +1,31 @@
package com.alexmumo.presentation.detail

import androidx.compose.ui.test.assertIsDisplayed
import androidx.compose.ui.test.junit4.createComposeRule
import androidx.compose.ui.test.onNodeWithTag
import androidx.compose.ui.test.onNodeWithText
import androidx.navigation.testing.TestNavHostController
import com.alexmumo.presentation.data.article
import org.junit.Rule
import org.junit.Test


class DetailScreenTest {

@get:Rule
@get:Rule(order = 1)
val composeRule = createComposeRule()

lateinit var navController: TestNavHostController

@Test
fun testDetailScreen() {
composeRule.setContent {
DetailScreen(navController = , article = )
DetailScreen(navController = navController, article = article)
}
composeRule.onNodeWithTag("detail_tag").assertExists()
composeRule.onNodeWithTag()
composeRule.onNodeWithText("Already Bookmarked").assertExists()
composeRule.onNodeWithTag("detail_screen").assertExists()

}

}

0 comments on commit 4a0a352

Please sign in to comment.