package com.peachpasswords.sync import org.junit.Assert.assertFalse import org.junit.Assert.assertTrue import org.junit.Test class SyncNotificationPersistenceTest { @Test fun `user dismissal restores the notification while background sync is enabled`() { assertTrue( shouldRestoreSyncNotification( ACTION_RESTORE_SYNC_NOTIFICATION, backgroundSyncEnabled = true, ), ) } @Test fun `disabled background sync never restores a dismissed notification`() { assertFalse( shouldRestoreSyncNotification( ACTION_RESTORE_SYNC_NOTIFICATION, backgroundSyncEnabled = false, ), ) } @Test fun `unrelated broadcasts cannot restore the notification`() { assertFalse( shouldRestoreSyncNotification( "com.peachpasswords.action.UNRELATED", backgroundSyncEnabled = true, ), ) } }