-
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 pull request #124 from snuhcs-course/test/integration-settings
Fix settings integration test bug
- Loading branch information
Showing
8 changed files
with
29 additions
and
85 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
39 changes: 0 additions & 39 deletions
39
frontend/app/src/androidTest/java/com/example/speechbuddy/AndroidTestUtil.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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
package com.example.speechbuddy | ||
|
||
import android.content.Intent | ||
import androidx.activity.compose.setContent | ||
import androidx.compose.foundation.layout.PaddingValues | ||
import androidx.compose.ui.test.assertHasClickAction | ||
import androidx.compose.ui.test.assertIsDisplayed | ||
import androidx.compose.ui.test.assertIsEnabled | ||
import androidx.compose.ui.test.junit4.createAndroidComposeRule | ||
import androidx.compose.ui.test.onNodeWithText | ||
import com.example.speechbuddy.compose.settings.GuestSettings | ||
import com.example.speechbuddy.ui.SpeechBuddyTheme | ||
|
@@ -18,26 +18,21 @@ import org.junit.Test | |
|
||
@HiltAndroidTest | ||
class GuestSettingsScreenTest { | ||
private val androidTestUtil = AndroidTestUtil() | ||
|
||
@get:Rule(order = 0) | ||
val hiltRule = HiltAndroidRule(this) | ||
|
||
@get:Rule(order = 1) | ||
val composeTestRule = androidTestUtil.createAndroidIntentComposeRule<HomeActivity> { | ||
Intent(it, HomeActivity::class.java).apply { | ||
putExtra("isTest", true) | ||
} | ||
} | ||
val composeTestRule = createAndroidComposeRule<AuthActivity>() | ||
|
||
@Before | ||
fun setUp() { | ||
hiltRule.inject() | ||
val guestId = -1 | ||
val fakeEmail = "guest" | ||
val fakeNickname = "guest" | ||
composeTestRule.activity.sessionManager.setUserId(guestId) | ||
composeTestRule.activity.userRepository.setMyInfo(guestId, fakeEmail, fakeNickname) | ||
val fakeId = 1 | ||
val fakeEmail = "[email protected]" | ||
val fakeNickname = "nickname" | ||
composeTestRule.activity.sessionManager.setUserId(fakeId) | ||
composeTestRule.activity.userRepository.setMyInfo(fakeId, fakeEmail, fakeNickname) | ||
composeTestRule.activity.setContent { | ||
SpeechBuddyTheme( | ||
settingsRepository = composeTestRule.activity.settingsRepository, | ||
|
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