-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into dependabot/bundler/cyclonedx-cocoapods-1.4.1
- Loading branch information
Showing
189 changed files
with
8,449 additions
and
1,505 deletions.
There are no files selected for viewing
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
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
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
57 changes: 57 additions & 0 deletions
57
androidApp/src/androidTest/java/com/mbta/tid/mbta_app/android/ContentViewTests.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,57 @@ | ||
package com.mbta.tid.mbta_app.android | ||
|
||
import android.app.Activity | ||
import androidx.compose.runtime.CompositionLocalProvider | ||
import androidx.compose.ui.platform.LocalContext | ||
import androidx.compose.ui.test.assertIsDisplayed | ||
import androidx.compose.ui.test.junit4.createComposeRule | ||
import androidx.compose.ui.test.onNodeWithText | ||
import androidx.compose.ui.test.performClick | ||
import androidx.test.rule.GrantPermissionRule | ||
import com.mbta.tid.mbta_app.android.location.MockFusedLocationProviderClient | ||
import com.mbta.tid.mbta_app.android.util.LocalActivity | ||
import com.mbta.tid.mbta_app.android.util.LocalLocationClient | ||
import com.mbta.tid.mbta_app.dependencyInjection.repositoriesModule | ||
import com.mbta.tid.mbta_app.network.MockPhoenixSocket | ||
import com.mbta.tid.mbta_app.network.PhoenixSocket | ||
import org.junit.Rule | ||
import org.junit.Test | ||
import org.koin.compose.KoinContext | ||
import org.koin.dsl.koinApplication | ||
import org.koin.dsl.module | ||
import org.koin.test.KoinTest | ||
|
||
class ContentViewTests : KoinTest { | ||
|
||
@get:Rule | ||
val runtimePermissionRule = | ||
GrantPermissionRule.grant(android.Manifest.permission.ACCESS_FINE_LOCATION) | ||
@get:Rule val composeTestRule = createComposeRule() | ||
|
||
val koinApplication = koinApplication { | ||
modules( | ||
repositoriesModule(MockRepositories.buildWithDefaults()), | ||
module { single<PhoenixSocket> { MockPhoenixSocket() } } | ||
) | ||
} | ||
|
||
@Test | ||
fun testSwitchingTabs() { | ||
composeTestRule.setContent { | ||
KoinContext(koinApplication.koin) { | ||
CompositionLocalProvider( | ||
LocalActivity provides (LocalContext.current as Activity), | ||
LocalLocationClient provides MockFusedLocationProviderClient() | ||
) { | ||
ContentView() | ||
} | ||
} | ||
} | ||
|
||
composeTestRule.onNodeWithText("More").performClick() | ||
composeTestRule.onNodeWithText("MBTA Go").assertIsDisplayed() | ||
|
||
composeTestRule.onNodeWithText("Nearby").performClick() | ||
composeTestRule.onNodeWithText("Nearby Transit").assertIsDisplayed() | ||
} | ||
} |
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
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
Oops, something went wrong.