Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for custom lists #5737

Merged
merged 11 commits into from
Feb 8, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class ConnectScreenTest {
uiState =
ConnectUiState(
location = null,
relayLocation = null,
selectedRelayItem = null,
tunnelUiState = TunnelState.Connecting(null, null),
tunnelRealState = TunnelState.Connecting(null, null),
inAddress = null,
Expand Down Expand Up @@ -112,7 +112,7 @@ class ConnectScreenTest {
uiState =
ConnectUiState(
location = null,
relayLocation = null,
selectedRelayItem = null,
tunnelUiState =
TunnelState.Connecting(endpoint = mockTunnelEndpoint, null),
tunnelRealState =
Expand Down Expand Up @@ -147,7 +147,7 @@ class ConnectScreenTest {
uiState =
ConnectUiState(
location = null,
relayLocation = null,
selectedRelayItem = null,
tunnelUiState = TunnelState.Connected(mockTunnelEndpoint, null),
tunnelRealState = TunnelState.Connected(mockTunnelEndpoint, null),
inAddress = null,
Expand Down Expand Up @@ -179,7 +179,7 @@ class ConnectScreenTest {
uiState =
ConnectUiState(
location = null,
relayLocation = null,
selectedRelayItem = null,
tunnelUiState = TunnelState.Connected(mockTunnelEndpoint, null),
tunnelRealState = TunnelState.Connected(mockTunnelEndpoint, null),
inAddress = null,
Expand All @@ -204,15 +204,15 @@ class ConnectScreenTest {
fun testDisconnectingState() {
composeExtension.use {
// Arrange
val mockRelayLocation: RelayItem = mockk(relaxed = true)
val mockSelectedLocation: RelayItem = mockk(relaxed = true)
val mockLocationName = "Home"
every { mockRelayLocation.locationName } returns mockLocationName
every { mockSelectedLocation.locationName } returns mockLocationName
setContentWithTheme {
ConnectScreen(
uiState =
ConnectUiState(
location = null,
relayLocation = mockRelayLocation,
selectedRelayItem = mockSelectedLocation,
tunnelUiState =
TunnelState.Disconnecting(ActionAfterDisconnect.Nothing),
tunnelRealState =
Expand All @@ -239,15 +239,15 @@ class ConnectScreenTest {
fun testDisconnectedState() {
composeExtension.use {
// Arrange
val mockRelayLocation: RelayItem = mockk(relaxed = true)
val mockSelectedLocation: RelayItem = mockk(relaxed = true)
val mockLocationName = "Home"
every { mockRelayLocation.locationName } returns mockLocationName
every { mockSelectedLocation.locationName } returns mockLocationName
setContentWithTheme {
ConnectScreen(
uiState =
ConnectUiState(
location = null,
relayLocation = mockRelayLocation,
selectedRelayItem = mockSelectedLocation,
tunnelUiState = TunnelState.Disconnected(),
tunnelRealState = TunnelState.Disconnected(),
inAddress = null,
Expand All @@ -272,15 +272,15 @@ class ConnectScreenTest {
fun testErrorStateBlocked() {
composeExtension.use {
// Arrange
val mockRelayLocation: RelayItem = mockk(relaxed = true)
val mockSelectedLocation: RelayItem = mockk(relaxed = true)
val mockLocationName = "Home"
every { mockRelayLocation.locationName } returns mockLocationName
every { mockSelectedLocation.locationName } returns mockLocationName
setContentWithTheme {
ConnectScreen(
uiState =
ConnectUiState(
location = null,
relayLocation = mockRelayLocation,
selectedRelayItem = mockSelectedLocation,
tunnelUiState =
TunnelState.Error(
ErrorState(ErrorStateCause.StartTunnelError, true)
Expand Down Expand Up @@ -315,15 +315,15 @@ class ConnectScreenTest {
fun testErrorStateNotBlocked() {
composeExtension.use {
// Arrange
val mockRelayLocation: RelayItem = mockk(relaxed = true)
val mockSelectedLocation: RelayItem = mockk(relaxed = true)
val mockLocationName = "Home"
every { mockRelayLocation.locationName } returns mockLocationName
every { mockSelectedLocation.locationName } returns mockLocationName
setContentWithTheme {
ConnectScreen(
uiState =
ConnectUiState(
location = null,
relayLocation = mockRelayLocation,
selectedRelayItem = mockSelectedLocation,
tunnelUiState =
TunnelState.Error(
ErrorState(ErrorStateCause.StartTunnelError, false)
Expand Down Expand Up @@ -364,7 +364,7 @@ class ConnectScreenTest {
uiState =
ConnectUiState(
location = null,
relayLocation = null,
selectedRelayItem = null,
tunnelUiState =
TunnelState.Disconnecting(ActionAfterDisconnect.Reconnect),
tunnelRealState =
Expand Down Expand Up @@ -393,15 +393,15 @@ class ConnectScreenTest {
fun testDisconnectingBlockState() {
composeExtension.use {
// Arrange
val mockRelayLocation: RelayItem = mockk(relaxed = true)
val mockSelectedLocation: RelayItem = mockk(relaxed = true)
val mockLocationName = "Home"
every { mockRelayLocation.locationName } returns mockLocationName
every { mockSelectedLocation.locationName } returns mockLocationName
setContentWithTheme {
ConnectScreen(
uiState =
ConnectUiState(
location = null,
relayLocation = mockRelayLocation,
selectedRelayItem = mockSelectedLocation,
tunnelUiState = TunnelState.Disconnecting(ActionAfterDisconnect.Block),
tunnelRealState =
TunnelState.Disconnecting(ActionAfterDisconnect.Block),
Expand All @@ -428,16 +428,16 @@ class ConnectScreenTest {
fun testClickSelectLocationButton() {
composeExtension.use {
// Arrange
val mockRelayLocation: RelayItem = mockk(relaxed = true)
val mockSelectedLocation: RelayItem = mockk(relaxed = true)
val mockLocationName = "Home"
every { mockRelayLocation.locationName } returns mockLocationName
every { mockSelectedLocation.name } returns mockLocationName
val mockedClickHandler: () -> Unit = mockk(relaxed = true)
setContentWithTheme {
ConnectScreen(
uiState =
ConnectUiState(
location = null,
relayLocation = mockRelayLocation,
selectedRelayItem = mockSelectedLocation,
tunnelUiState = TunnelState.Disconnected(),
tunnelRealState = TunnelState.Disconnected(),
inAddress = null,
Expand Down Expand Up @@ -471,7 +471,7 @@ class ConnectScreenTest {
uiState =
ConnectUiState(
location = null,
relayLocation = null,
selectedRelayItem = null,
tunnelUiState = TunnelState.Connected(mockTunnelEndpoint, null),
tunnelRealState = TunnelState.Connected(mockTunnelEndpoint, null),
inAddress = null,
Expand Down Expand Up @@ -505,7 +505,7 @@ class ConnectScreenTest {
uiState =
ConnectUiState(
location = null,
relayLocation = null,
selectedRelayItem = null,
tunnelUiState = TunnelState.Connected(mockTunnelEndpoint, null),
tunnelRealState = TunnelState.Connected(mockTunnelEndpoint, null),
inAddress = null,
Expand Down Expand Up @@ -538,7 +538,7 @@ class ConnectScreenTest {
uiState =
ConnectUiState(
location = null,
relayLocation = null,
selectedRelayItem = null,
tunnelUiState = TunnelState.Disconnected(),
tunnelRealState = TunnelState.Disconnected(),
inAddress = null,
Expand Down Expand Up @@ -571,7 +571,7 @@ class ConnectScreenTest {
uiState =
ConnectUiState(
location = null,
relayLocation = null,
selectedRelayItem = null,
tunnelUiState = TunnelState.Connecting(null, null),
tunnelRealState = TunnelState.Connecting(null, null),
inAddress = null,
Expand Down Expand Up @@ -612,7 +612,7 @@ class ConnectScreenTest {
uiState =
ConnectUiState(
location = mockLocation,
relayLocation = null,
selectedRelayItem = null,
tunnelUiState = TunnelState.Connected(mockTunnelEndpoint, null),
tunnelRealState = TunnelState.Connected(mockTunnelEndpoint, null),
inAddress = mockInAddress,
Expand Down Expand Up @@ -653,7 +653,7 @@ class ConnectScreenTest {
uiState =
ConnectUiState(
location = null,
relayLocation = null,
selectedRelayItem = null,
tunnelUiState = TunnelState.Connecting(null, null),
tunnelRealState = TunnelState.Connecting(null, null),
inAddress = null,
Expand Down Expand Up @@ -689,7 +689,7 @@ class ConnectScreenTest {
uiState =
ConnectUiState(
location = null,
relayLocation = null,
selectedRelayItem = null,
tunnelUiState = TunnelState.Connecting(null, null),
tunnelRealState = TunnelState.Connecting(null, null),
inAddress = null,
Expand Down Expand Up @@ -722,7 +722,7 @@ class ConnectScreenTest {
uiState =
ConnectUiState(
location = null,
relayLocation = null,
selectedRelayItem = null,
tunnelUiState = TunnelState.Connecting(null, null),
tunnelRealState = TunnelState.Connecting(null, null),
inAddress = null,
Expand Down Expand Up @@ -760,7 +760,7 @@ class ConnectScreenTest {
uiState =
ConnectUiState(
location = null,
relayLocation = null,
selectedRelayItem = null,
tunnelUiState = TunnelState.Connecting(null, null),
tunnelRealState = TunnelState.Connecting(null, null),
inAddress = null,
Expand Down Expand Up @@ -794,7 +794,7 @@ class ConnectScreenTest {
uiState =
ConnectUiState(
location = null,
relayLocation = null,
selectedRelayItem = null,
tunnelUiState = TunnelState.Connecting(null, null),
tunnelRealState = TunnelState.Connecting(null, null),
inAddress = null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class SelectLocationScreenTest {
relayListState =
RelayListState.RelayList(
countries = DUMMY_RELAY_COUNTRIES,
selectedRelay = null
selectedItem = null
),
selectedOwnership = null,
selectedProvidersCount = 0,
Expand Down Expand Up @@ -99,7 +99,7 @@ class SelectLocationScreenTest {
relayListState =
RelayListState.RelayList(
countries = updatedDummyList,
selectedRelay = updatedDummyList[0].cities[0].relays[0]
selectedItem = updatedDummyList[0].cities[0].relays[0]
),
selectedOwnership = null,
selectedProvidersCount = 0,
Expand Down Expand Up @@ -129,7 +129,7 @@ class SelectLocationScreenTest {
relayListState =
RelayListState.RelayList(
countries = emptyList(),
selectedRelay = null
selectedItem = null
),
selectedOwnership = null,
selectedProvidersCount = 0,
Expand Down
Loading
Loading