|
|
|
@ -90,6 +90,7 @@ class InstalledAddonDetailsFragmentTest {
|
|
|
|
|
every { fragment.provideEnableSwitch() } returns enableSwitch
|
|
|
|
|
every { fragment.providePrivateBrowsingSwitch() } returns privateBrowsingSwitch
|
|
|
|
|
every { addon.isDisabledAsBlocklisted() } returns false
|
|
|
|
|
every { addon.isDisabledAsNotCorrectlySigned() } returns false
|
|
|
|
|
every { addon.isEnabled() } returns true
|
|
|
|
|
every { fragment.addon } returns addon
|
|
|
|
|
|
|
|
|
@ -97,4 +98,22 @@ class InstalledAddonDetailsFragmentTest {
|
|
|
|
|
|
|
|
|
|
verify(exactly = 0) { enableSwitch.isEnabled = false }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
fun `GIVEN addon not correctly signed WHEN biding the enable switch THEN disable the switch`() {
|
|
|
|
|
val addon = mockk<Addon>()
|
|
|
|
|
val enableSwitch = mockk<SwitchMaterial>(relaxed = true)
|
|
|
|
|
val privateBrowsingSwitch = mockk<SwitchMaterial>(relaxed = true)
|
|
|
|
|
|
|
|
|
|
every { fragment.provideEnableSwitch() } returns enableSwitch
|
|
|
|
|
every { fragment.providePrivateBrowsingSwitch() } returns privateBrowsingSwitch
|
|
|
|
|
every { addon.isEnabled() } returns true
|
|
|
|
|
every { addon.isDisabledAsBlocklisted() } returns false
|
|
|
|
|
every { addon.isDisabledAsNotCorrectlySigned() } returns true
|
|
|
|
|
every { fragment.addon } returns addon
|
|
|
|
|
|
|
|
|
|
fragment.bindEnableSwitch()
|
|
|
|
|
|
|
|
|
|
verify { enableSwitch.isEnabled = false }
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|