Skip to content

test(desktop): end-to-end coverage for quit, settings repair, links, browser and file grant flows - #10685

Merged
waleedlatif1 merged 2 commits into
stagingfrom
feat/desktop-acceptance-e2e
Dec 2, 2026
Merged

waleedlatif1 merged 2 commits into
stagingfrom
feat/desktop-acceptance-e2e

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

End-to-end coverage, against the real Electron app, for the desktop fixes that only had unit tests:

  • Quit guard (quit-guard.spec.ts): a real zsh terminal runs a command; quitting shows "Quit Sim?" with Cancel focused; Enter (Cancel) keeps the app, its window and the command; a second quit asks again, and Quit Anyway exits the app and stops the command.
  • Settings repair (startup.spec.ts): a settings file with a trailing comma shows the repair prompt with Not Now focused; Not Now leaves the file byte-identical through quit, with no backup; Reset Settings writes settings.json.bak-<ts> with the original bytes, rewrites the file, and restarts (the relaunch is recorded rather than spawned). A chmod 000 file is reported with OK and Show File only, never reset, and left unchanged.
  • Download staging cleanup (startup.spec.ts): .sim-download-* files (and their .crdownload) last modified more than a day ago are removed at launch; a recent one and the user's own files stay.
  • Quick chat shortcut migration (quick-chat.spec.ts): a settings file without the setting keeps ⌥Space and stores it; a fresh profile registers nothing and stores null; relaunching that profile still registers nothing.
  • Links (smoke.spec.ts): from a Sim window, an app link prompts "Open ?" with Cancel as the default, and Open hands it over; plain http opens in the system browser. From an MCP OAuth popup, app links and plain http are refused with no prompt, while https still opens.
  • Built-in browser (browser-find-and-media.spec.ts): Cmd+F on a page that handles it itself doesn't open Sim's find bar, and on a page that doesn't, it opens. With Chromium's fake camera, a camera the user allowed is given again without a prompt while its tab is in front, refused from a background tab, and given again once the tab is back in front.

Two harness helpers (shellDialog, clickAsAppExits). No production code changes. Real apps and OS consent are stubbed in the main process (shell.openExternal, app.getApplicationNameForProtocol, app.relaunch, macOS camera consent), as existing specs already do.

Not automated here:

  • Folder grants across two FAT32 disk images: left out of this PR.
  • Repair and updater prompts on a login launch: login-launch detection only applies to packaged builds (app.isPackaged). The unpackaged suite can't simulate a login launch, and faking isPackaged would change unrelated packaged-only paths.

The packaged-smoke job (package-smoke in desktop-e2e) builds an unsigned universal .app and runs packaged-smoke.spec.ts. It checks the production fuse policy and that the packaged shell logs its launch, renders the bundled offline page from app.asar, and opens the server picker through the local-page IPC gate.

Type of Change

  • Tests

Testing

  • bunx tsc --noEmit -p apps/desktop, biome on the changed files, and playwright test --list for discovery, all run locally.
  • The specs run in CI's desktop-e2e workflow on macOS runners; none were run locally.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • No new warnings introduced

@vercel

vercel Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Dec 2, 2026 11:04pm UTC

Request Review

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 7 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

@greptile-apps

greptile-apps Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5RetriggerView in Greptile

[Low impact] The PR appears safe to merge; no actionable issue was found in the reviewed changes.

Summary

Adds Electron end-to-end tests for quitting with running work, settings repair, download cleanup, shortcut migration, external links, find shortcuts, and camera access.

  • Startup tests now check how Sim preserves unusable settings.
  • Quit tests now check what happens around a running terminal command.
  • Link tests now check which outside links Sim allows.
  • Browser find tests now check when Sim opens its find bar.
  • Camera tests now check grants against the active browser tab.
  • Quick Chat tests now check shortcut defaults across profiles.
  • Startup tests now check cleanup of abandoned download files.

Reviews (2) · Last reviewed commit: "test(desktop): tolerate dialogs closing ..." · Reviewed by Greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 7 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1
waleedlatif1 merged commit ccefe62 into staging Dec 2, 2026
50 checks passed
@waleedlatif1
waleedlatif1 deleted the feat/desktop-acceptance-e2e branch December 3, 2026 00:44

This branch was previously deployed

1 inactive deployment
Preview — 489bbd83 Deployed Dec 2, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant