Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.flow.asSharedFlow
import kotlinx.coroutines.flow.asStateFlow
import kotlinx.coroutines.launch
import org.wordpress.android.BuildConfig
import org.wordpress.android.fluxc.store.AccountStore
import org.wordpress.android.fluxc.utils.AppLogWrapper
import org.wordpress.android.support.model.UserInfo
Expand Down Expand Up @@ -62,8 +63,8 @@ class SupportViewModel @Inject constructor(
)

_optionsVisibility.value = SupportOptionsVisibility(
showAskTheBots = hasAccessToken,
showAskHappinessEngineers = hasAccessToken
showAskTheBots = hasAccessToken && BuildConfig.IS_JETPACK_APP,
showAskHappinessEngineers = hasAccessToken && BuildConfig.IS_JETPACK_APP
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,11 @@ class SupportViewModelTest : BaseUnitTest() {
viewModel.init()

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

@Test
Expand Down