mirror of
https://github.com/sotashimozono/obsidian-remote-ssh.git
synced 2026-07-22 17:10:32 +00:00
sync.spec's create/edit/delete went red once the Settings overlay was closed.
The overlay was not what made them work; removing it just made the whole run
faster and exposed two latent faults the spec had carried all along.
1. THE REAL RACE. `beforeAll` used `connectAndOpenShadow`, which returns as
soon as the PLUGIN LOADS — the SSH connect, the ADAPTER PATCH and
populateVaultFromRemote all land later, at layout-ready. A write fired
before the patch goes to the shadow vault's LOCAL directory and never
reaches the remote. That is the same race restart-settings.spec hit, and
the same pre-connect window #342/#429 lives in. With the overlay up the run
was slow enough that the connect had usually landed first; without it, it
hadn't. Now: capture the shadow path via the building blocks and block on
`waitForShadowVaultLoaded` before any test runs.
2. SILENT SKIPS. The rename was `if (await inlineTitle.isVisible(...))` — when
false it was skipped without a word, leaving the note as `Untitled.md`, and
the test then failed on `remote.exists('e2e-test-<stamp>.md')` with a
message that named nothing. `delete` had the same shape around its confirm
dialog. Note that Playwright's isVisible() does NOT hit-test (an element
under an overlay still reports visible) while click() does — so overlay
presence silently flipped which steps worked. Both branches are gone; every
stage is now asserted and dumps the active file / fileMap / open modals on
failure.
Drive path is now `app.vault.create/modify/delete` via page.evaluate. In the
shadow window `app.vault.adapter` IS the patched adapter, so the write still
traverses every line of plugin code a keystroke would have reached; the only
thing dropped is Obsidian's own contenteditable→debounce→vault.modify step,
which is not the product under test. The REMOTE assertions — independent SFTP
ground truth via RemoteVerifier — are unchanged, and two are stronger:
`edit` now asserts the original text is GONE (a stray append used to satisfy
it), and `delete` now asserts the file was actually THERE first (it could
previously pass vacuously). Fixed waitForTimeout sleeps replaced with
expect.poll against the remote.
|
||
|---|---|---|
| .. | ||
| e2e | ||
| scripts | ||
| src | ||
| tests | ||
| esbuild.config.mjs | ||
| eslint.config.mjs | ||
| manifest.json | ||
| package-lock.json | ||
| package.json | ||
| styles.css | ||
| tsconfig.json | ||
| versions.json | ||
| vitest.config.ts | ||
| vitest.integration.config.ts | ||
| vitest.replay.config.ts | ||
| vitest.setup.ts | ||