budget-app/app/tests/test_capture_panel_contract.py
Arena Assistant 1988457dd1 feat: add macOS capture panel and Android Makepad review
Reuse shared review and confirmation state. Android tile/setup and volatile OCR handoff route into Makepad; native floating controls remain. Android overlay rendering host is not implemented. Prior isolated checks: macOS ARM64 and Android ARM64 library checks, native Linux build/run and tests; native mobile/macOS runtime validation remains outstanding.
2026-10-28 05:02:41 +00:00

33 lines
1.5 KiB
Python

"""Source-level guards only; these do not replace native macOS UI tests."""
from pathlib import Path
import unittest
ROOT = Path(__file__).resolve().parents[2]
class CapturePanelContract(unittest.TestCase):
def test_panel_has_no_financial_confirmation_path(self):
source = (ROOT / 'app/src/capture_panel.rs').read_text()
self.assertIn('MacosWindowConfig::floating_panel()', source)
self.assertIn('start_capture_from_control(cx)', source)
self.assertIn('cancel_capture_from_control(cx)', source)
self.assertNotIn('desktop_confirm', source)
self.assertNotIn('Review::new', source)
self.assertNotIn('CaptureJob::start', source)
def test_capture_hides_panel_before_starting_worker(self):
source = (ROOT / 'app/src/desktop_capture_ui.rs').read_text()
self.assertLess(source.index('set_capture_panel_visible(false)'),
source.index('CaptureJob::start'))
self.assertIn('if self.capture_job.is_some() || self.capture_review.is_some()', source)
def test_platform_scope_and_native_host_only(self):
shell = (ROOT / 'app/src/shell.rs').read_text()
self.assertIn('#[cfg(target_os = "macos")]\n#[path = "capture_panel.rs"]', shell)
native = (ROOT / 'budget-capture/src/sys/desktop/mod.rs').read_text()
self.assertIn('window.orderOut(None)', native)
self.assertIn('window.orderFrontRegardless()', native)
if __name__ == '__main__':
unittest.main()