Skip to content

Commit

Permalink
Rename viewActions to uiSideEffect
Browse files Browse the repository at this point in the history
  • Loading branch information
albin-mullvad committed Sep 29, 2023
1 parent f9d2d87 commit 5d0e3c0
Show file tree
Hide file tree
Showing 23 changed files with 145 additions and 142 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class AccountScreenTest {
accountNumber = DUMMY_ACCOUNT_NUMBER,
accountExpiry = null
),
viewActions = MutableSharedFlow<AccountViewModel.ViewAction>().asSharedFlow(),
uiSideEffect = MutableSharedFlow<AccountViewModel.UiSideEffect>().asSharedFlow(),
enterTransitionEndAction = MutableSharedFlow<Unit>().asSharedFlow()
)
}
Expand All @@ -60,7 +60,7 @@ class AccountScreenTest {
accountNumber = DUMMY_ACCOUNT_NUMBER,
accountExpiry = null
),
viewActions = MutableSharedFlow<AccountViewModel.ViewAction>().asSharedFlow(),
uiSideEffect = MutableSharedFlow<AccountViewModel.UiSideEffect>().asSharedFlow(),
enterTransitionEndAction = MutableSharedFlow<Unit>().asSharedFlow(),
onManageAccountClick = mockedClickHandler
)
Expand All @@ -86,7 +86,7 @@ class AccountScreenTest {
accountNumber = DUMMY_ACCOUNT_NUMBER,
accountExpiry = null
),
viewActions = MutableSharedFlow<AccountViewModel.ViewAction>().asSharedFlow(),
uiSideEffect = MutableSharedFlow<AccountViewModel.UiSideEffect>().asSharedFlow(),
enterTransitionEndAction = MutableSharedFlow<Unit>().asSharedFlow(),
onRedeemVoucherClick = mockedClickHandler
)
Expand All @@ -112,7 +112,7 @@ class AccountScreenTest {
accountNumber = DUMMY_ACCOUNT_NUMBER,
accountExpiry = null
),
viewActions = MutableSharedFlow<AccountViewModel.ViewAction>().asSharedFlow(),
uiSideEffect = MutableSharedFlow<AccountViewModel.UiSideEffect>().asSharedFlow(),
enterTransitionEndAction = MutableSharedFlow<Unit>().asSharedFlow(),
onLogoutClick = mockedClickHandler
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class ConnectScreenTest {
composeTestRule.setContent {
ConnectScreen(
uiState = ConnectUiState.INITIAL,
viewActions = MutableSharedFlow<ConnectViewModel.ViewAction>().asSharedFlow()
uiSideEffect = MutableSharedFlow<ConnectViewModel.UiSideEffect>().asSharedFlow()
)
}

Expand Down Expand Up @@ -86,7 +86,7 @@ class ConnectScreenTest {
connectNotificationState =
ConnectNotificationState.ShowTunnelStateNotificationBlocked
),
viewActions = MutableSharedFlow<ConnectViewModel.ViewAction>().asSharedFlow()
uiSideEffect = MutableSharedFlow<ConnectViewModel.UiSideEffect>().asSharedFlow()
)
}

Expand Down Expand Up @@ -121,7 +121,7 @@ class ConnectScreenTest {
connectNotificationState =
ConnectNotificationState.ShowTunnelStateNotificationBlocked
),
viewActions = MutableSharedFlow<ConnectViewModel.ViewAction>().asSharedFlow()
uiSideEffect = MutableSharedFlow<ConnectViewModel.UiSideEffect>().asSharedFlow()
)
}

Expand Down Expand Up @@ -153,7 +153,7 @@ class ConnectScreenTest {
isTunnelInfoExpanded = false,
connectNotificationState = ConnectNotificationState.HideNotification
),
viewActions = MutableSharedFlow<ConnectViewModel.ViewAction>().asSharedFlow()
uiSideEffect = MutableSharedFlow<ConnectViewModel.UiSideEffect>().asSharedFlow()
)
}

Expand Down Expand Up @@ -184,7 +184,7 @@ class ConnectScreenTest {
isTunnelInfoExpanded = false,
connectNotificationState = ConnectNotificationState.HideNotification
),
viewActions = MutableSharedFlow<ConnectViewModel.ViewAction>().asSharedFlow()
uiSideEffect = MutableSharedFlow<ConnectViewModel.UiSideEffect>().asSharedFlow()
)
}

Expand Down Expand Up @@ -216,7 +216,7 @@ class ConnectScreenTest {
isTunnelInfoExpanded = false,
connectNotificationState = ConnectNotificationState.HideNotification
),
viewActions = MutableSharedFlow<ConnectViewModel.ViewAction>().asSharedFlow()
uiSideEffect = MutableSharedFlow<ConnectViewModel.UiSideEffect>().asSharedFlow()
)
}

Expand Down Expand Up @@ -248,7 +248,7 @@ class ConnectScreenTest {
isTunnelInfoExpanded = false,
connectNotificationState = ConnectNotificationState.HideNotification
),
viewActions = MutableSharedFlow<ConnectViewModel.ViewAction>().asSharedFlow()
uiSideEffect = MutableSharedFlow<ConnectViewModel.UiSideEffect>().asSharedFlow()
)
}

Expand Down Expand Up @@ -285,7 +285,7 @@ class ConnectScreenTest {
ErrorState(ErrorStateCause.StartTunnelError, true)
)
),
viewActions = MutableSharedFlow<ConnectViewModel.ViewAction>().asSharedFlow()
uiSideEffect = MutableSharedFlow<ConnectViewModel.UiSideEffect>().asSharedFlow()
)
}

Expand Down Expand Up @@ -323,7 +323,7 @@ class ConnectScreenTest {
ErrorState(ErrorStateCause.StartTunnelError, false)
)
),
viewActions = MutableSharedFlow<ConnectViewModel.ViewAction>().asSharedFlow()
uiSideEffect = MutableSharedFlow<ConnectViewModel.UiSideEffect>().asSharedFlow()
)
}

Expand Down Expand Up @@ -356,7 +356,7 @@ class ConnectScreenTest {
connectNotificationState =
ConnectNotificationState.ShowTunnelStateNotificationBlocked
),
viewActions = MutableSharedFlow<ConnectViewModel.ViewAction>().asSharedFlow()
uiSideEffect = MutableSharedFlow<ConnectViewModel.UiSideEffect>().asSharedFlow()
)
}

Expand Down Expand Up @@ -391,7 +391,7 @@ class ConnectScreenTest {
connectNotificationState =
ConnectNotificationState.ShowTunnelStateNotificationBlocked
),
viewActions = MutableSharedFlow<ConnectViewModel.ViewAction>().asSharedFlow()
uiSideEffect = MutableSharedFlow<ConnectViewModel.UiSideEffect>().asSharedFlow()
)
}

Expand Down Expand Up @@ -425,7 +425,7 @@ class ConnectScreenTest {
isTunnelInfoExpanded = false,
connectNotificationState = ConnectNotificationState.HideNotification
),
viewActions = MutableSharedFlow<ConnectViewModel.ViewAction>().asSharedFlow(),
uiSideEffect = MutableSharedFlow<ConnectViewModel.UiSideEffect>().asSharedFlow(),
onSwitchLocationClick = mockedClickHandler
)
}
Expand Down Expand Up @@ -456,7 +456,7 @@ class ConnectScreenTest {
isTunnelInfoExpanded = false,
connectNotificationState = ConnectNotificationState.HideNotification
),
viewActions = MutableSharedFlow<ConnectViewModel.ViewAction>().asSharedFlow(),
uiSideEffect = MutableSharedFlow<ConnectViewModel.UiSideEffect>().asSharedFlow(),
onDisconnectClick = mockedClickHandler
)
}
Expand Down Expand Up @@ -487,7 +487,7 @@ class ConnectScreenTest {
isTunnelInfoExpanded = false,
connectNotificationState = ConnectNotificationState.HideNotification
),
viewActions = MutableSharedFlow<ConnectViewModel.ViewAction>().asSharedFlow(),
uiSideEffect = MutableSharedFlow<ConnectViewModel.UiSideEffect>().asSharedFlow(),
onReconnectClick = mockedClickHandler
)
}
Expand Down Expand Up @@ -517,7 +517,7 @@ class ConnectScreenTest {
isTunnelInfoExpanded = false,
connectNotificationState = ConnectNotificationState.HideNotification
),
viewActions = MutableSharedFlow<ConnectViewModel.ViewAction>().asSharedFlow(),
uiSideEffect = MutableSharedFlow<ConnectViewModel.UiSideEffect>().asSharedFlow(),
onConnectClick = mockedClickHandler
)
}
Expand Down Expand Up @@ -547,7 +547,7 @@ class ConnectScreenTest {
isTunnelInfoExpanded = false,
connectNotificationState = ConnectNotificationState.HideNotification
),
viewActions = MutableSharedFlow<ConnectViewModel.ViewAction>().asSharedFlow(),
uiSideEffect = MutableSharedFlow<ConnectViewModel.UiSideEffect>().asSharedFlow(),
onCancelClick = mockedClickHandler
)
}
Expand Down Expand Up @@ -578,7 +578,7 @@ class ConnectScreenTest {
isTunnelInfoExpanded = false,
connectNotificationState = ConnectNotificationState.HideNotification
),
viewActions = MutableSharedFlow<ConnectViewModel.ViewAction>().asSharedFlow(),
uiSideEffect = MutableSharedFlow<ConnectViewModel.UiSideEffect>().asSharedFlow(),
onToggleTunnelInfo = mockedClickHandler
)
}
Expand Down Expand Up @@ -616,7 +616,7 @@ class ConnectScreenTest {
isTunnelInfoExpanded = true,
connectNotificationState = ConnectNotificationState.HideNotification
),
viewActions = MutableSharedFlow<ConnectViewModel.ViewAction>().asSharedFlow()
uiSideEffect = MutableSharedFlow<ConnectViewModel.UiSideEffect>().asSharedFlow()
)
}

Expand Down Expand Up @@ -654,7 +654,7 @@ class ConnectScreenTest {
connectNotificationState =
ConnectNotificationState.ShowVersionInfoNotification(versionInfo)
),
viewActions = MutableSharedFlow<ConnectViewModel.ViewAction>().asSharedFlow()
uiSideEffect = MutableSharedFlow<ConnectViewModel.UiSideEffect>().asSharedFlow()
)
}

Expand Down Expand Up @@ -690,7 +690,7 @@ class ConnectScreenTest {
connectNotificationState =
ConnectNotificationState.ShowVersionInfoNotification(versionInfo)
),
viewActions = MutableSharedFlow<ConnectViewModel.ViewAction>().asSharedFlow()
uiSideEffect = MutableSharedFlow<ConnectViewModel.UiSideEffect>().asSharedFlow()
)
}

Expand Down Expand Up @@ -723,7 +723,7 @@ class ConnectScreenTest {
connectNotificationState =
ConnectNotificationState.ShowAccountExpiryNotification(expiryDate)
),
viewActions = MutableSharedFlow<ConnectViewModel.ViewAction>().asSharedFlow()
uiSideEffect = MutableSharedFlow<ConnectViewModel.UiSideEffect>().asSharedFlow()
)
}

Expand Down Expand Up @@ -761,7 +761,7 @@ class ConnectScreenTest {
connectNotificationState =
ConnectNotificationState.ShowVersionInfoNotification(versionInfo)
),
viewActions = MutableSharedFlow<ConnectViewModel.ViewAction>().asSharedFlow()
uiSideEffect = MutableSharedFlow<ConnectViewModel.UiSideEffect>().asSharedFlow()
)
}

Expand Down Expand Up @@ -793,7 +793,7 @@ class ConnectScreenTest {
connectNotificationState =
ConnectNotificationState.ShowAccountExpiryNotification(expiryDate)
),
viewActions = MutableSharedFlow<ConnectViewModel.ViewAction>().asSharedFlow()
uiSideEffect = MutableSharedFlow<ConnectViewModel.UiSideEffect>().asSharedFlow()
)
}

Expand All @@ -810,9 +810,9 @@ class ConnectScreenTest {
composeTestRule.setContent {
ConnectScreen(
uiState = ConnectUiState.INITIAL,
viewActions =
uiSideEffect =
MutableStateFlow(
ConnectViewModel.ViewAction.OpenAccountManagementPageInBrowser("222")
ConnectViewModel.UiSideEffect.OpenAccountManagementPageInBrowser("222")
)
)
}
Expand All @@ -828,7 +828,7 @@ class ConnectScreenTest {
composeTestRule.setContent {
ConnectScreen(
uiState = ConnectUiState.INITIAL,
viewActions = MutableStateFlow(ConnectViewModel.ViewAction.OpenOutOfTimeView),
uiSideEffect = MutableStateFlow(ConnectViewModel.UiSideEffect.OpenOutOfTimeView),
onOpenOutOfTimeScreen = mockedOpenScreenHandler
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class OutOfTimeScreenTest {
OutOfTimeScreen(
showSitePayment = false,
uiState = OutOfTimeUiState(),
viewActions = MutableSharedFlow(),
uiSideEffect = MutableSharedFlow(),
onSitePaymentClick = {},
onRedeemVoucherClick = {},
onSettingsClick = {},
Expand Down Expand Up @@ -58,8 +58,8 @@ class OutOfTimeScreenTest {
OutOfTimeScreen(
showSitePayment = true,
uiState = OutOfTimeUiState(),
viewActions =
MutableStateFlow(OutOfTimeViewModel.ViewAction.OpenAccountView("222")),
uiSideEffect =
MutableStateFlow(OutOfTimeViewModel.UiSideEffect.OpenAccountView("222")),
onSitePaymentClick = {},
onRedeemVoucherClick = {},
onSettingsClick = {},
Expand All @@ -81,7 +81,7 @@ class OutOfTimeScreenTest {
OutOfTimeScreen(
showSitePayment = true,
uiState = OutOfTimeUiState(),
viewActions = MutableStateFlow(OutOfTimeViewModel.ViewAction.OpenConnectScreen),
uiSideEffect = MutableStateFlow(OutOfTimeViewModel.UiSideEffect.OpenConnectScreen),
onSitePaymentClick = {},
onRedeemVoucherClick = {},
onSettingsClick = {},
Expand All @@ -103,7 +103,7 @@ class OutOfTimeScreenTest {
OutOfTimeScreen(
showSitePayment = true,
uiState = OutOfTimeUiState(),
viewActions = MutableSharedFlow(),
uiSideEffect = MutableSharedFlow(),
onSitePaymentClick = mockClickListener,
onRedeemVoucherClick = {},
onSettingsClick = {},
Expand All @@ -128,7 +128,7 @@ class OutOfTimeScreenTest {
OutOfTimeScreen(
showSitePayment = true,
uiState = OutOfTimeUiState(),
viewActions = MutableSharedFlow(),
uiSideEffect = MutableSharedFlow(),
onSitePaymentClick = {},
onRedeemVoucherClick = mockClickListener,
onSettingsClick = {},
Expand All @@ -153,7 +153,7 @@ class OutOfTimeScreenTest {
OutOfTimeScreen(
showSitePayment = true,
uiState = OutOfTimeUiState(tunnelState = TunnelState.Connecting(null, null)),
viewActions = MutableSharedFlow(),
uiSideEffect = MutableSharedFlow(),
onSitePaymentClick = {},
onRedeemVoucherClick = {},
onSettingsClick = {},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class WelcomeScreenTest {
WelcomeScreen(
showSitePayment = true,
uiState = WelcomeUiState(),
viewActions = MutableSharedFlow(),
uiSideEffect = MutableSharedFlow(),
onSitePaymentClick = {},
onRedeemVoucherClick = {},
onSettingsClick = {},
Expand All @@ -52,7 +52,7 @@ class WelcomeScreenTest {
WelcomeScreen(
showSitePayment = false,
uiState = WelcomeUiState(),
viewActions = MutableSharedFlow(),
uiSideEffect = MutableSharedFlow(),
onSitePaymentClick = {},
onRedeemVoucherClick = {},
onSettingsClick = {},
Expand Down Expand Up @@ -81,7 +81,7 @@ class WelcomeScreenTest {
WelcomeScreen(
showSitePayment = true,
uiState = WelcomeUiState(accountNumber = rawAccountNumber),
viewActions = MutableSharedFlow(),
uiSideEffect = MutableSharedFlow(),
onSitePaymentClick = {},
onRedeemVoucherClick = {},
onSettingsClick = {},
Expand All @@ -101,7 +101,8 @@ class WelcomeScreenTest {
WelcomeScreen(
showSitePayment = true,
uiState = WelcomeUiState(),
viewActions = MutableStateFlow(WelcomeViewModel.ViewAction.OpenAccountView("222")),
uiSideEffect =
MutableStateFlow(WelcomeViewModel.UiSideEffect.OpenAccountView("222")),
onSitePaymentClick = {},
onRedeemVoucherClick = {},
onSettingsClick = {},
Expand All @@ -122,7 +123,7 @@ class WelcomeScreenTest {
WelcomeScreen(
showSitePayment = true,
uiState = WelcomeUiState(),
viewActions = MutableStateFlow(WelcomeViewModel.ViewAction.OpenConnectScreen),
uiSideEffect = MutableStateFlow(WelcomeViewModel.UiSideEffect.OpenConnectScreen),
onSitePaymentClick = {},
onRedeemVoucherClick = {},
onSettingsClick = {},
Expand All @@ -143,7 +144,7 @@ class WelcomeScreenTest {
WelcomeScreen(
showSitePayment = true,
uiState = WelcomeUiState(),
viewActions = MutableStateFlow(WelcomeViewModel.ViewAction.OpenConnectScreen),
uiSideEffect = MutableStateFlow(WelcomeViewModel.UiSideEffect.OpenConnectScreen),
onSitePaymentClick = mockClickListener,
onRedeemVoucherClick = {},
onSettingsClick = {},
Expand All @@ -167,7 +168,7 @@ class WelcomeScreenTest {
WelcomeScreen(
showSitePayment = true,
uiState = WelcomeUiState(),
viewActions = MutableStateFlow(WelcomeViewModel.ViewAction.OpenConnectScreen),
uiSideEffect = MutableStateFlow(WelcomeViewModel.UiSideEffect.OpenConnectScreen),
onSitePaymentClick = {},
onRedeemVoucherClick = mockClickListener,
onSettingsClick = {},
Expand Down
Loading

0 comments on commit 5d0e3c0

Please sign in to comment.