sotashimozono_obsidian-remo.../plugin/tests/__mocks__
sotashimozono 358bf9fc06
test(AdapterManager,ShadowStartupCoordinator): coverage for lifecycle and F2 startup paths (#267)
* test(AdapterManager,ShadowStartupCoordinator): coverage for lifecycle and startup paths

AdapterManager.test.ts (17 tests):
- PATCHED_METHODS constant: shape, read-side, write-side, bridge, basePath
- isPatched() false on fresh instance
- dataAdapter getter null on fresh instance
- replayOfflineQueue(): early return (both labels)
- showPendingEditsModal(): early return with no queue
- restore(): idempotent, calls unsubscribe(), clears transferTracker

ShadowStartupCoordinator.test.ts (5 tests):
- prepareForAutoConnect(): resolves when suggestions absent/empty
- does not call saveSettings when there is nothing to install
- idempotent on repeated calls

Also adds requestUrl stub to __mocks__/obsidian.ts so the coordinator
import succeeds without a real Obsidian runtime.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* test(shadow): expand ShadowStartupCoordinator coverage to F2 design intent

Add 15 tests covering all pendingPluginSuggestions decision branches:
- no suggestions (undefined/empty array): no modal, no side effects
- decision later: snapshot preserved, no save, no install
- decision skip: snapshot cleared, saveSettings called, no install
- decision install: installMissing called with selected ids, snapshot cleared,
  settings saved; edge cases: empty selection, all-failed installs

Fixes the previous test file which only covered no-suggestion paths and
left the core F2 plugin-suggestion flow (arch §9) entirely untested.

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 22:31:42 +09:00
..
obsidian.ts test(AdapterManager,ShadowStartupCoordinator): coverage for lifecycle and F2 startup paths (#267) 2026-05-09 22:31:42 +09:00