Medlar/docs/tests/S033-tray-notify.md
astar76 4ac8cd9379 S033: tray, notifications, launcher progress, autostart, metainfo, test file
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-25 22:49:31 -06:00

3.3 KiB

S033 test file: tray, notifications, launcher, autostart

All bus checks run under dbus-run-session with fake services, never the user's session bus. Autostart checks use a throwaway config folder.

HIGH

  1. Fake StatusNotifierWatcher present: Tray::start returns Some; the fake host sees id medlar, an ARGB pixmap of 64x64 and a menu with Show, Add, a 4-way mode group, Pause all, Resume all, Quit.
  2. No watcher on the bus: Tray::start returns None, no panic; closing the window then really closes it (hides_on_close false).
  3. Fake host calls the menu items: the app receives Do::Show, Add, PauseAll, ResumeAll, Mode(x), Quit in order; Quit sets quitting and the window closes even with close-to-tray on.
  4. Close to tray on, tray present: window close request is cancelled and the window hides; Show brings it back focused.
  5. Fake Notifications service: a download going Running to Done yields one Notify call with summary "Download finished", actions open and folder, hint desktop-entry=medlar.
  6. Fake service emits ActionInvoked(id, "folder") then "open": the app gets Do::Folder / Do::Open of the file. Unknown id or key: nothing happens.
  7. Failed with kind Login gives a "Sign-in needed" note with action continue, which opens the sign-in dialog for that link; plain Failed gives retry, which resumes the download.
  8. Autostart: sync_with(tmp, exe, true, true) writes autostart/medlar.desktop with Exec=... --minimised; a path with spaces is quoted; false removes it; removing twice is fine.

MED

  1. First snapshot after start sends no notifications (baseline only); paused-then-done also notifies; Done seen on load does not.
  2. 5 finished in one batch give one "5 downloads finished" note; 3 give three.
  3. "All downloads are finished" comes once when the last running download ends after at least one finish, not when the last one is paused.
  4. Quiet hours: span 22:00-07:00 is quiet at 23:00 and 03:00, not at 12:00; equal ends never quiet; with quiet on, no Notify call reaches the fake service.
  5. Setting notify off: no Notify calls.
  6. Tray ring: with progress None the icon equals the app icon; at 50% the right half of the ring is opaque, left half faint, centre untouched. Tooltip reads "N running, speed" and "Nothing is downloading" when idle.
  7. Launcher: a fake bus listener sees com.canonical.Unity.LauncherEntry.Update with application://medlar.desktop, progress between 0 and 1, progress-visible true while downloading and false after.
  8. medlar --minimised is accepted by wants, is not passed on as a link, and starts hidden only if a tray exists.
  9. tools/validate-desktop.sh passes; with desktop-file-validate and appstreamcli present, both report no errors.

LOW

  1. Settings round trip keeps tray, close_to_tray, start_minimised, autostart, notify, quiet, quiet_from, quiet_to; an old file without them gets the defaults.

Doubts

  • A hidden window may get no redraws on Wayland, so tray commands, notifications and launcher updates could stall while it is hidden. Check by hiding to tray, then clicking Show, and finishing a download while hidden.
  • No settings page controls the new settings yet (file only); a later plan adds the rows.
  • The ksni tooltip and radio group look differs per tray host; check in KDE and a GNOME host if available.
  • The Unity signal body (s, a{sv}) is built with zbus tuple flattening; verify on the wire.