fancive_obsidian-parallel-r.../tests
fancivez a5d9d74b54 feat: toggle right sidebar instead of detaching tab + component tests
UX change:
- The "open Parallel Reader" command now toggles the right sidebar's
  collapsed state instead of detaching the leaf. The tab and its content
  are preserved across hide/show, matching standard Obsidian behaviour
  for File Explorer and friends. Detaching the tab on every second
  press destroyed cached cards and forced re-generation.

Behaviour:
- No leaf yet → create + reveal
- Leaf exists, right sidebar collapsed → reveal (expands sidebar)
- Leaf exists, right sidebar expanded → collapse(); tab is preserved
- No right sidebar (mobile / unusual layout) → reveal as fallback

Tests:
- New tests/view-render.test.js (18 cases) covering the component layer
  that was previously a gap. The 1.0.12 → 1.0.13 sidebar regression
  could not have been caught by any existing pure-function test; this
  file fills that gap by mocking app.workspace + view spies and running
  real runForFile / refreshViewAfterCache* / toggleParallelView.
- shouldRender matrix (4 cases): silentView × sourceFile state — the
  exact regression introduced in PR2 where guards were over-applied.
- toggleParallelView (4 cases): no-leaf opens, expanded → collapse,
  collapsed → reveal, no-rightSplit fallback.
- refreshViewAfterCacheDelete + Clear (4 cases): matching file vs
  different file vs no-view, plus clear-all always renderEmpty.
- runForFile outcome enum mapping (6 cases): already-running early
  return, already-running from catch, cancelled, generic error,
  regenerate-confirm cancellation, skipEditConfirm bypass — these
  drive batch statistics and were untested before.
- view.deleteCard / updateCard cardPersistFailed path (3 cases):
  exposes ParallelReaderView via test-exports for instantiation;
  mocks cacheReplaceCards returning false to verify the failure
  notice path lands and the public method returns false.

src/test-exports.ts: export ParallelReaderView for component tests.
tests/catalog.json: register view-render.test.js under component.

Change-Id: I439b5fca07b0928e6fe44d9025c2421c71c6cb28
2026-05-02 15:38:41 +08:00
..
anchor.test.js lint: extend Biome coverage to tests/ and scripts/ 2026-04-27 19:53:35 +08:00
architecture.test.js test: split architecture guard tests 2026-04-29 13:53:19 +08:00
cache.test.js lint: extend Biome coverage to tests/ and scripts/ 2026-04-27 19:53:35 +08:00
cards-nav.test.js refactor: split modules.test.js into 12 per-module test files 2026-04-27 15:21:03 +08:00
catalog.json feat: toggle right sidebar instead of detaching tab + component tests 2026-05-02 15:38:41 +08:00
cli.test.js fix: address 13 review findings (security, UX, i18n) 2026-05-02 12:50:35 +08:00
direct-batch.test.js lint: extend Biome coverage to tests/ and scripts/ 2026-04-27 19:53:35 +08:00
direct-cache.test.js fix: address 10 P2 behavioral and concurrency findings 2026-05-02 13:52:49 +08:00
direct-generation.test.js lint: extend Biome coverage to tests/ and scripts/ 2026-04-27 19:53:35 +08:00
direct-i18n.test.js lint: extend Biome coverage to tests/ and scripts/ 2026-04-27 19:53:35 +08:00
direct-markdown.test.js lint: extend Biome coverage to tests/ and scripts/ 2026-04-27 19:53:35 +08:00
direct-prompt.test.js fix: address 10 P2 behavioral and concurrency findings 2026-05-02 13:52:49 +08:00
direct-providers.test.js lint: extend Biome coverage to tests/ and scripts/ 2026-04-27 19:53:35 +08:00
direct-settings-extra.test.js lint: extend Biome coverage to tests/ and scripts/ 2026-04-27 19:53:35 +08:00
direct-settings.test.js lint: extend Biome coverage to tests/ and scripts/ 2026-04-27 19:53:35 +08:00
direct-streaming.test.js lint: extend Biome coverage to tests/ and scripts/ 2026-04-27 19:53:35 +08:00
direct-test-setup.js lint: extend Biome coverage to tests/ and scripts/ 2026-04-27 19:53:35 +08:00
generation-job-manager.test.js fix: address 10 P2 behavioral and concurrency findings 2026-05-02 13:52:49 +08:00
i18n.test.js fix: add cancel action to batch prompt 2026-04-29 14:13:47 +08:00
markdown.test.js refactor: split modules.test.js into 12 per-module test files 2026-04-27 15:21:03 +08:00
obsidian-mock.js lint: extend Biome coverage to tests/ and scripts/ 2026-04-27 19:53:35 +08:00
plugin-batch.test.js fix: address 10 P2 behavioral and concurrency findings 2026-05-02 13:52:49 +08:00
providers.test.js refactor: split main.test.js into focused test files 2026-04-27 19:59:46 +08:00
schema.test.js fix: address 13 review findings (security, UX, i18n) 2026-05-02 12:50:35 +08:00
scroll.test.js lint: extend Biome coverage to tests/ and scripts/ 2026-04-27 19:53:35 +08:00
settings.test.js fix: address 10 P2 behavioral and concurrency findings 2026-05-02 13:52:49 +08:00
streaming.test.js fix: address 10 P2 behavioral and concurrency findings 2026-05-02 13:52:49 +08:00
test-exports.test.js fix: address 10 P2 behavioral and concurrency findings 2026-05-02 13:52:49 +08:00
test-setup.js fix: address CR findings — bump script, test runner, temp cleanup 2026-04-27 20:19:53 +08:00
vault-batch.test.js lint: extend Biome coverage to tests/ and scripts/ 2026-04-27 19:53:35 +08:00
view-render.test.js feat: toggle right sidebar instead of detaching tab + component tests 2026-05-02 15:38:41 +08:00