Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Fixed #473 failing test cases #550

Merged
merged 1 commit into from
Oct 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion noty-android/app/composeapp/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ android {

buildTypes {
debug {
testCoverageEnabled true
testCoverageEnabled false
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package dev.shreyaspatil.noty.composeapp

import androidx.activity.compose.setContent
import androidx.activity.viewModels
import androidx.compose.runtime.Composable
import androidx.compose.ui.test.junit4.AndroidComposeTestRule
Expand Down Expand Up @@ -57,7 +58,7 @@ abstract class NotyScreenTest {
body: AndroidComposeTestRule<ActivityScenarioRule<MainActivity>, MainActivity>.() -> Unit
) = composeTestRule.run(body)

fun setNotyContent(content: @Composable () -> Unit) = composeTestRule.setContent {
fun setNotyContent(content: @Composable () -> Unit) = composeTestRule.activity.setContent {
NotyTheme {
content()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,11 +196,11 @@ class NotesScreenTest : NotyScreenTest() {
setNotyContent { NotesScreen(onNavigateToNoteDetail = { navigateToNoteId = it }) }
registerIdlingResource(prefillNotes())

onNodeWithText("Lorem Ipsum 1").performClick()
onNodeWithText("Lorem Ipsum 1", useUnmergedTree = true).performClick()
waitForIdle()
assertEquals("1", navigateToNoteId)

onNodeWithText("Hello World 2").performClick()
onNodeWithText("Hello World 2", useUnmergedTree = true).performClick()
waitForIdle()
assertEquals("2", navigateToNoteId)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
package dev.shreyaspatil.noty.composeapp.ui

import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.app.AppCompatDelegate
import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.material.Surface
Expand All @@ -38,7 +38,7 @@ import dev.shreyaspatil.noty.view.viewmodel.NoteDetailViewModel
import javax.inject.Inject

@AndroidEntryPoint
class MainActivity : AppCompatActivity() {
class MainActivity : ComponentActivity() {

@Inject
lateinit var preferenceManager: PreferenceManager
Expand Down