From 04d9fb784d8ec0e3434101b0270686e39aad68f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20G=C3=B6ransson?= Date: Fri, 20 Dec 2024 07:34:47 +0100 Subject: [PATCH] Add sorting regression test --- .../mullvadvpn/viewmodel/FilterViewModelTest.kt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/android/app/src/test/kotlin/net/mullvad/mullvadvpn/viewmodel/FilterViewModelTest.kt b/android/app/src/test/kotlin/net/mullvad/mullvadvpn/viewmodel/FilterViewModelTest.kt index 6fc4ccf97f44..49b9b4baffa8 100644 --- a/android/app/src/test/kotlin/net/mullvad/mullvadvpn/viewmodel/FilterViewModelTest.kt +++ b/android/app/src/test/kotlin/net/mullvad/mullvadvpn/viewmodel/FilterViewModelTest.kt @@ -157,4 +157,14 @@ class FilterViewModelTest { assertLists(expectedProviderList, state.allProviders) } } + + @Test + fun `ensure that providers are sorted by name`() = runTest { + // Assert + viewModel.uiState.test { + val state = awaitItem() + assertEquals(state.allProviders.sorted(), state.allProviders) + assertEquals(state.selectableProviders.sorted(), state.selectableProviders) + } + } }