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

[Bug] Fix root cause that caused StatsGranularTabsTest to fail. #20606

Merged
merged 9 commits into from
Apr 17, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@ import dagger.hilt.android.testing.HiltAndroidTest
import org.junit.After
import org.junit.Assume.assumeTrue
import org.junit.Before
import org.junit.Ignore
import org.junit.Test
import org.wordpress.android.BuildConfig
import org.wordpress.android.R
import org.wordpress.android.e2e.pages.MySitesPage
import org.wordpress.android.rules.Retry
import org.wordpress.android.support.BaseTest
import org.wordpress.android.support.ComposeEspressoLink
import org.wordpress.android.support.WPSupportUtils
Expand All @@ -38,7 +36,6 @@ class StatsGranularTabsTest : BaseTest() {
}
}

@Ignore("The 'Days' screen might occasionally not load. Disabled until tests rerun is implemented.")
@Test
fun e2eAllDayStatsLoad() {
val todayVisits = StatsVisitsData("97", "28", "14", "11")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,9 @@ abstract class BaseStatsUseCase<DOMAIN_MODEL, UI_STATE>(
val useCaseState = when (state) {
is Error -> ERROR
is Data -> {
if (!state.cached) {
val updatedCachedData = loadCachedData()
if (domainModel != updatedCachedData) {
domainModel = updatedCachedData
updateState()
}
if (!state.cached && domainModel != state.model) {
domainModel = state.model
updateState()
}
SUCCESS
}
Expand Down
Loading