Standardize naming of actions related to account switcher (#363)

This commit is contained in:
Brian Yencho
2023-12-11 11:49:32 -06:00
committed by GitHub
parent a4db8c7a60
commit faa8948712
8 changed files with 25 additions and 23 deletions

View File

@@ -341,7 +341,7 @@ class LandingScreenTest : BaseComposeTest() {
verify {
viewModel.trySendAction(
LandingAction.ConfirmSwitchToMatchingAccountClick(account = accountSummary),
LandingAction.ConfirmSwitchToMatchingAccountClick(accountSummary = accountSummary),
)
}
}

View File

@@ -81,14 +81,14 @@ class VaultScreenTest : BaseComposeTest() {
@Suppress("MaxLineLength")
@Test
fun `account click in the account switcher should send AccountSwitchClick and close switcher`() {
fun `account click in the account switcher should send SwitchAccountClick and close switcher`() {
// Open the Account Switcher
val accountSummaries = DEFAULT_STATE.accountSummaries
composeTestRule.performAccountIconClick()
composeTestRule.performAccountClick(accountSummary = LOCKED_ACCOUNT_SUMMARY)
verify { viewModel.trySendAction(VaultAction.AccountSwitchClick(LOCKED_ACCOUNT_SUMMARY)) }
verify { viewModel.trySendAction(VaultAction.SwitchAccountClick(LOCKED_ACCOUNT_SUMMARY)) }
composeTestRule.assertSwitcherIsNotDisplayed(
accountSummaries = accountSummaries,
)

View File

@@ -81,7 +81,7 @@ class VaultViewModelTest : BaseViewModelTest() {
switchAccountResult = SwitchAccountResult.AccountSwitched
val updatedUserId = "lockedUserId"
viewModel.trySendAction(
VaultAction.AccountSwitchClick(
VaultAction.SwitchAccountClick(
accountSummary = mockk() {
every { userId } returns updatedUserId
},
@@ -146,13 +146,13 @@ class VaultViewModelTest : BaseViewModelTest() {
@Suppress("MaxLineLength")
@Test
fun `on AccountSwitchClick when result is NoChange should try to switch to the given account and set isSwitchingAccounts to false`() =
fun `on SwitchAccountClick when result is NoChange should try to switch to the given account and set isSwitchingAccounts to false`() =
runTest {
val viewModel = createViewModel()
switchAccountResult = SwitchAccountResult.NoChange
val updatedUserId = "lockedUserId"
viewModel.trySendAction(
VaultAction.AccountSwitchClick(
VaultAction.SwitchAccountClick(
accountSummary = mockk {
every { userId } returns updatedUserId
},
@@ -167,13 +167,13 @@ class VaultViewModelTest : BaseViewModelTest() {
@Suppress("MaxLineLength")
@Test
fun `on AccountSwitchClick when result is AccountSwitched should switch to the given account and set isSwitchingAccounts to true`() =
fun `on SwitchAccountClick when result is AccountSwitched should switch to the given account and set isSwitchingAccounts to true`() =
runTest {
val viewModel = createViewModel()
switchAccountResult = SwitchAccountResult.AccountSwitched
val updatedUserId = "lockedUserId"
viewModel.trySendAction(
VaultAction.AccountSwitchClick(
VaultAction.SwitchAccountClick(
accountSummary = mockk {
every { userId } returns updatedUserId
},
@@ -312,7 +312,7 @@ class VaultViewModelTest : BaseViewModelTest() {
switchAccountResult = SwitchAccountResult.AccountSwitched
val updatedUserId = "lockedUserId"
viewModel.trySendAction(
VaultAction.AccountSwitchClick(
VaultAction.SwitchAccountClick(
accountSummary = mockk() {
every { userId } returns updatedUserId
},