Add screen capture protection (#292)
Co-authored-by: Rahul Sharma <rahul.shwork@gmail.com>
This commit is contained in:
parent
8366d76dcd
commit
6897496423
6 changed files with 77 additions and 2 deletions
|
|
@ -319,6 +319,25 @@ class MainViewModelTest {
|
|||
verify { mockEditor.putString("external_file_behavior", "KEEP") }
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `screen capture protection persists and updates state`() = runTest {
|
||||
backgroundScope.launch(UnconfinedTestDispatcher(testScheduler)) {
|
||||
viewModel.uiState.collect {}
|
||||
}
|
||||
|
||||
viewModel.setScreenCaptureProtectionEnabled(true)
|
||||
|
||||
val enabledState = viewModel.uiState.first { it.isScreenCaptureProtectionEnabled }
|
||||
assertTrue(enabledState.isScreenCaptureProtectionEnabled)
|
||||
verify { mockEditor.putBoolean("screen_capture_protection_enabled", true) }
|
||||
|
||||
viewModel.setScreenCaptureProtectionEnabled(false)
|
||||
|
||||
val disabledState = viewModel.uiState.first { !it.isScreenCaptureProtectionEnabled }
|
||||
assertFalse(disabledState.isScreenCaptureProtectionEnabled)
|
||||
verify { mockEditor.putBoolean("screen_capture_protection_enabled", false) }
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `setSortOrder persists preference and reorders visible home and library lists`() = runTest {
|
||||
backgroundScope.launch(UnconfinedTestDispatcher(testScheduler)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue