Skip to content

Commit ae9a87a

Browse files
authored
CMM-891: support: hide bots and he entries in WP (#22313)
* Hiding entries in WP build * detekt
1 parent 9f23ed4 commit ae9a87a

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

WordPress/src/main/java/org/wordpress/android/support/main/ui/SupportViewModel.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import kotlinx.coroutines.flow.StateFlow
1010
import kotlinx.coroutines.flow.asSharedFlow
1111
import kotlinx.coroutines.flow.asStateFlow
1212
import kotlinx.coroutines.launch
13+
import org.wordpress.android.BuildConfig
1314
import org.wordpress.android.fluxc.store.AccountStore
1415
import org.wordpress.android.fluxc.utils.AppLogWrapper
1516
import org.wordpress.android.support.common.model.UserInfo
@@ -58,8 +59,8 @@ class SupportViewModel @Inject constructor(
5859
)
5960

6061
_optionsVisibility.value = SupportOptionsVisibility(
61-
showAskTheBots = hasAccessToken,
62-
showAskHappinessEngineers = hasAccessToken
62+
showAskTheBots = hasAccessToken && BuildConfig.IS_JETPACK_APP,
63+
showAskHappinessEngineers = hasAccessToken && BuildConfig.IS_JETPACK_APP
6364
)
6465
}
6566

WordPress/src/test/java/org/wordpress/android/support/main/ui/SupportViewModelTest.kt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,13 @@ class SupportViewModelTest : BaseUnitTest() {
142142
viewModel.init()
143143

144144
// Then
145-
assertThat(viewModel.optionsVisibility.value.showAskTheBots).isTrue()
146-
assertThat(viewModel.optionsVisibility.value.showAskHappinessEngineers).isTrue()
145+
// Note: For WordPress variant (IS_JETPACK_APP=false), these options should be hidden
146+
// For Jetpack variant (IS_JETPACK_APP=true), they should be shown when user has access token
147+
// This test will behave differently based on which variant is being tested
148+
assertThat(viewModel.optionsVisibility.value.showAskTheBots)
149+
.isEqualTo(org.wordpress.android.BuildConfig.IS_JETPACK_APP)
150+
assertThat(viewModel.optionsVisibility.value.showAskHappinessEngineers)
151+
.isEqualTo(org.wordpress.android.BuildConfig.IS_JETPACK_APP)
147152
}
148153

149154
@Test

0 commit comments

Comments
 (0)