mirror of
https://github.com/sotashimozono/obsidian-remote-ssh.git
synced 2026-07-22 17:10:32 +00:00
OnboardingModal: - Generate-key button now has UI-level coverage (M1) — happy path, EEXIST refusal, and non-absolute-path guard. SshKeyGen is vi.mock'd so the test never touches ~/.ssh. - Browse-button test switched from raw querySelector to clickButton (M2) — uses the helper this PR introduced, fails loudly if the button is missing instead of relying on `.toBeTruthy() + !.click()`. Mock: - makeButton: drop the dead `typeof document !== 'undefined'` branch (L1). The mock requires jsdom — no need to defend against the node env that no longer exists. - clickButton JSDoc documents the single-microtask drain limit and points at vi.waitFor for setTimeout/fire-and-forget cases (L4). Setup: - Drop the no-op `afterAll` from vitest.setup.ts (L2) — the polyfills are set at module init and never torn down anyway. - Switch clearNotices import to 'obsidian' (L3) so the alias is exercised end-to-end and the setup file isn't coupled to the physical mock path. Coverage: OnboardingModal.ts 50.9→66.66% lines (+15.7), 36.84→47.36% branches (+10.5). Global lines 69.62→70.4%. Tests: 760 → 763 (+3 Generate-key cases). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| OnboardingModal.test.ts | ||