Uh oh!
There was an error while loading. Please reload this page.
test(e2e): sandbox HOME and cover user-scope skill deletion - #1530
Merged
Conversation
#1517 let the Skills panel delete from `~/.maka/skills` and `~/.agents/skills`. `buildE2eEnv` never overrode HOME, so an E2E run enumerated the developer's real user-scope skills — and a spec that exercised the delete button would have removed one of them for real. That is why #1517 shipped without an e2e for its own destructive path. Set HOME (and USERPROFILE) to a directory inside the throwaway userData dir that teardown already removes. Overriding the home dir sandboxes every consumer at once, rather than threading a `homeDir` option through each skills API and hoping none is missed — if list and delete disagreed about which directories they mean, the bug would be invisible and destructive. userData is pinned separately via app.setPath, so this does not move the app's data dir. `e2eHomeDir()` exposes the sandbox to specs. It is a plain accessor read from the test body, deliberately not a fixture: a fixture would have no declared dependency on the window fixture, so Playwright could resolve it first and hand back a stale path. The invocable-skills seeder gains one user-scope skill under the sandbox, which is what makes the journey assertable. New spec covers what the unit tests cannot — the renderer sending a scope-aware ref through IPC and the list agreeing afterwards: - a user-scope skill is removed from disk and drops out of the list, with the disk still intact after the FIRST of the two confirm clicks; - a project-scope skill offers no delete button at all. Verified the disk assertion is not vacuous: inverting it to expect 'present' fails with `Received: "gone"`. Verified the sandbox introduces no new failures. Full e2e: 69 passed, 3 failed — `settings.spec.ts:141` and `sidebar-navigation.spec.ts:10` fail identically with this change stashed (pre-existing on this machine, green in CI), and `sidebar-navigation.spec.ts:30` is flaky, passing on the stashed baseline in the same session. Gates: desktop test + typecheck exit 0, format:check and knip clean.
Uh oh!
There was an error while loading. Please reload this page.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
#1517 let the Skills panel delete from
~/.maka/skillsand~/.agents/skills.buildE2eEnvnever overrodeHOME, so an E2E run enumerated the developer's real user-scope skills — and any spec that exercised the delete button would have removed one for real.That is exactly why #1517 shipped without an e2e for its own destructive path. This closes that gap.
How
Set
HOME(andUSERPROFILE) to a directory inside the throwaway userData dir that teardown already removes — no second path to leak.Overriding the home dir sandboxes every consumer at once, rather than threading a
homeDiroption through each skills API and hoping none is missed. That distinction matters here: ifskills:listandskills:deleteever disagreed about which directories they mean, the bug would be both invisible and destructive.userDatais pinned separately viaapp.setPath, so this does not move the app's data dir.e2eHomeDir(), not a fixtureThe sandbox path is exposed as a plain accessor read from the test body. A fixture would have no declared dependency on the window fixture, so Playwright could resolve it before the window is set up and hand back a stale path.
New coverage
The invocable-skills seeder gains one user-scope skill under the sandbox, which is what makes the journey assertable. The spec covers what the unit tests in
skills.test.tscannot — the renderer sending a scope-aware ref through IPC, and the list agreeing afterwards:Verification
The disk assertion is not vacuous. Inverted it to expect
'present'after the delete; it fails withReceived: "gone". (The original form usedexpect(promise).rejects, which I could not convince myself wasn't passing for the wrong reason — replaced with an explicitexpect.poll.)The sandbox introduces no new failures. Full e2e on this branch: 69 passed, 3 failed. All three baselined with the change stashed and the app rebuilt:
settings.spec.ts:141sidebar-navigation.spec.ts:10sidebar-navigation.spec.ts:30The first two fail identically without this change — local-environment issues on my machine, green in CI.
Gates: desktop
testandtypecheckexit 0 ·format:checkclean ·knip --workspace apps/desktopclean.