A fully functional Android app built entirely with Kotlin and Jetpack Compose
Grant `POST_NOTIFICATIONS` permission in instrumented tests
Simon Marquis331e8cffaca5
diff --git a/feature/foryou/src/androidTest/java/com/google/samples/apps/nowinandroid/feature/foryou/ForYouScreenTest.kt b/feature/foryou/src/androidTest/java/com/google/samples/apps/nowinandroid/feature/foryou/ForYouScreenTest.ktindex eb27473bb..404ad55b9 100644--- a/feature/foryou/src/androidTest/java/com/google/samples/apps/nowinandroid/feature/foryou/ForYouScreenTest.kt+++ b/feature/foryou/src/androidTest/java/com/google/samples/apps/nowinandroid/feature/foryou/ForYouScreenTest.kt@@ -16,6 +16,7 @@package com.google.samples.apps.nowinandroid.feature.foryou+import android.Manifestimport androidx.activity.ComponentActivityimport androidx.compose.foundation.layout.BoxWithConstraintsimport androidx.compose.ui.test.assertHasClickAction@@ -28,6 +29,8 @@ import androidx.compose.ui.test.onFirstimport androidx.compose.ui.test.onNodeWithContentDescriptionimport androidx.compose.ui.test.onNodeWithTextimport androidx.compose.ui.test.performScrollToNode+import androidx.test.rule.GrantPermissionRule+import androidx.test.rule.GrantPermissionRule.grantimport com.google.samples.apps.nowinandroid.core.testing.data.followableTopicTestDataimport com.google.samples.apps.nowinandroid.core.testing.data.userNewsResourcesTestDataimport com.google.samples.apps.nowinandroid.core.ui.NewsFeedUiState@@ -35,6 +38,10 @@ import org.junit.Ruleimport org.junit.Testclass ForYouScreenTest {++ @get:Rule+ val permissionTestRule: GrantPermissionRule = grant(Manifest.permission.POST_NOTIFICATIONS)+@get:Ruleval composeTestRule = createAndroidComposeRule<ComponentActivity>()