mirror of
https://github.com/JustinZeus/Wholphin.git
synced 2026-07-09 16:11:20 +02:00
Show public users when switching users (#1358)
## Description Show the public users (ie "Hide this user from login screens" is unchecked) if the server has any. Previously, all users had to be explicitly added by username or quick connect. This PR also refactors the server & user pages to use modern state flows and deletes some unused code. ### Related issues Closes #600 ### Testing Emulator ## Screenshots N/A ## AI or LLM usage None
This commit is contained in:
parent
b23d30f94b
commit
dbd17597b2
9 changed files with 579 additions and 627 deletions
|
|
@ -7,6 +7,7 @@ import androidx.compose.ui.Modifier
|
|||
import androidx.compose.ui.input.key.Key
|
||||
import androidx.compose.ui.test.ExperimentalTestApi
|
||||
import androidx.compose.ui.test.assertIsDisplayed
|
||||
import androidx.compose.ui.test.assertIsEnabled
|
||||
import androidx.compose.ui.test.assertIsFocused
|
||||
import androidx.compose.ui.test.junit4.createAndroidComposeRule
|
||||
import androidx.compose.ui.test.onNodeWithTag
|
||||
|
|
@ -184,11 +185,15 @@ class BasicUiTests {
|
|||
composeTestRule.onNodeWithText("Enter Server IP or URL").assertIsDisplayed()
|
||||
|
||||
composeTestRule.onNodeWithTag("server_url_text").performTextInput("localhost")
|
||||
composeTestRule.onNodeWithText("Submit").requestFocus().performClickEnter()
|
||||
composeTestRule
|
||||
.onNodeWithText("Submit")
|
||||
.assertIsEnabled()
|
||||
.requestFocus()
|
||||
.performClickEnter()
|
||||
|
||||
TestModule.testDispatcher.scheduler.advanceUntilIdle()
|
||||
|
||||
switchServerViewModel.addServerState.value.let {
|
||||
switchServerViewModel.state.value.addServerState.let {
|
||||
if (it is LoadingState.Error) throw it.exception ?: Exception(it.message)
|
||||
}
|
||||
|
||||
|
|
@ -249,11 +254,15 @@ class BasicUiTests {
|
|||
composeTestRule.onNodeWithText("Enter Server IP or URL").assertIsDisplayed()
|
||||
|
||||
composeTestRule.onNodeWithTag("server_url_text").performTextInput("localhost")
|
||||
composeTestRule.onNodeWithText("Submit").requestFocus().performClickEnter()
|
||||
composeTestRule
|
||||
.onNodeWithText("Submit")
|
||||
.assertIsEnabled()
|
||||
.requestFocus()
|
||||
.performClickEnter()
|
||||
|
||||
TestModule.testDispatcher.scheduler.advanceUntilIdle()
|
||||
|
||||
Assert.assertTrue(switchServerViewModel.addServerState.value is LoadingState.Error)
|
||||
Assert.assertTrue(switchServerViewModel.state.value.addServerState is LoadingState.Error)
|
||||
|
||||
composeTestRule.onNodeWithText("Server returned invalid response").assertIsDisplayed()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue