Merge "Set preference invisible when no anomaly" into oc-mr1-dev

This commit is contained in:
TreeHugger Robot
2017-08-23 19:57:41 +00:00
committed by Android (Google) Code Review
2 changed files with 12 additions and 0 deletions

View File

@@ -106,6 +106,16 @@ public class AnomalySummaryPreferenceControllerTest {
assertThat(mPreference.getSummary()).isEqualTo("Keeping device awake");
}
@Test
public void testUpdateAnomalySummaryPreference_emptyAnomaly_preferenceInvisible() {
mPreference.setVisible(true);
mAnomalyList.clear();
mAnomalySummaryPreferenceController.updateAnomalySummaryPreference(mAnomalyList);
assertThat(mPreference.isVisible()).isFalse();
}
@Test
public void testUpdateAnomalySummaryPreference_multipleAnomalies_showCorrectSummary() {
mAnomalyList.add(createTestAnomaly());