Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0e800978 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

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

parents d0066e38 4242ee0d
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -102,6 +102,8 @@ public class AnomalySummaryPreferenceController {

            mAnomalyPreference.setTitle(title);
            mAnomalyPreference.setSummary(summary);
        } else {
            mAnomalyPreference.setVisible(false);
        }
    }

+10 −0
Original line number Diff line number Diff line
@@ -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());