From 0f0461518eb7967d1880d613de4f4b18bd64b8e6 Mon Sep 17 00:00:00 2001 From: Chun-Ku Lin Date: Sat, 3 Jun 2023 04:52:09 +0000 Subject: [PATCH] Update the FlashNotificationsPreferenceFragmentTest to return correct metric category **Root Cause** The test was written when the metric category is set to 0. After we update the metric category to FLASH_NOTIFICATION_SETTINGS in the FlashNotificationsPrefereenceFragment, we forgot to update the test. Bug: 279082331 Test: atest FlashNotificationsPreferenceFragmentTest Change-Id: Icd709bd9e571ca264226d0ca860e5c482eae3927 --- .../FlashNotificationsPreferenceFragmentTest.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/robotests/src/com/android/settings/accessibility/FlashNotificationsPreferenceFragmentTest.java b/tests/robotests/src/com/android/settings/accessibility/FlashNotificationsPreferenceFragmentTest.java index a063a9f45c2..ac6953dc380 100644 --- a/tests/robotests/src/com/android/settings/accessibility/FlashNotificationsPreferenceFragmentTest.java +++ b/tests/robotests/src/com/android/settings/accessibility/FlashNotificationsPreferenceFragmentTest.java @@ -22,6 +22,7 @@ import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; +import android.app.settings.SettingsEnums; import android.content.Context; import androidx.test.core.app.ApplicationProvider; @@ -66,8 +67,9 @@ public class FlashNotificationsPreferenceFragmentTest { } @Test - public void getMetricsCategory_isZero() { - assertThat(mFragment.getMetricsCategory()).isEqualTo(0); // TODO + public void getMetricsCategory_returnsCorrectCategory() { + assertThat(mFragment.getMetricsCategory()).isEqualTo( + SettingsEnums.FLASH_NOTIFICATION_SETTINGS); } @Test