Some checks failed
build-packages / resolve bundled mosh-client (push) Has been cancelled
build-packages / resolve bundled et-client (push) Has been cancelled
build-packages / build-macos (push) Has been cancelled
build-packages / build-windows (push) Has been cancelled
build-packages / build-linux-x64 (push) Has been cancelled
build-packages / build-linux-arm64 (push) Has been cancelled
build-packages / release (push) Has been cancelled
build-packages / update Nix release metadata (push) Has been cancelled
build-packages / bump homebrew tap (push) Has been cancelled
test / lint-and-test (push) Has been cancelled
AI automation / Route event (push) Has been cancelled
AI automation / Hand reopened issue to maintainers (push) Has been cancelled
AI automation / Clean source issue state (push) Has been cancelled
AI automation / Reconcile handoffs (push) Has been cancelled
AI automation / Classify issue (push) Has been cancelled
AI automation / Claude Code smoke (push) Has been cancelled
AI automation / Review issue follow-up (push) Has been cancelled
AI automation / Publish issue follow-up (push) Has been cancelled
AI automation / Implement with Claude Code (push) Has been cancelled
AI automation / Publish implement PR (push) Has been cancelled
AI automation / Continue queued issue comments (push) Has been cancelled
AI automation / Codex review loop (push) Has been cancelled
AI automation / Publish Codex fix (push) Has been cancelled
AI automation / Clear Codex dispatch marker (push) Has been cancelled
AI automation / Own PR re-request Codex (push) Has been cancelled
AI automation / External PR re-request Codex (push) Has been cancelled
AI automation / Poll Codex reaction / retry (push) Has been cancelled
build-et-binaries / build-linux-x64 (push) Has been cancelled
build-et-binaries / build-linux-arm64 (push) Has been cancelled
build-et-binaries / build-macos-universal (push) Has been cancelled
build-et-binaries / build-windows-x64 (push) Has been cancelled
build-et-binaries / release (push) Has been cancelled
52 lines
2.8 KiB
TypeScript
52 lines
2.8 KiB
TypeScript
import assert from "node:assert/strict";
|
|
import { readFileSync } from "node:fs";
|
|
import test from "node:test";
|
|
|
|
const vaultViewLayoutSource = readFileSync(new URL("./vault/VaultViewLayout.tsx", import.meta.url), "utf8");
|
|
const pluginImporterCommitHookSource = readFileSync(new URL("../application/state/usePluginImporterCommit.ts", import.meta.url), "utf8");
|
|
|
|
test("vault stage aligns its content to the top tab bar", () => {
|
|
assert.match(vaultViewLayoutSource, /className="flex min-w-0 flex-1 py-0 pr-2 pb-2 pl-0"/);
|
|
assert.doesNotMatch(vaultViewLayoutSource, /className="flex min-w-0 flex-1 p-2 pl-0"/);
|
|
});
|
|
|
|
test("vault notes stay mounted while switching sections", () => {
|
|
assert.match(vaultViewLayoutSource, /data-section="vault-notes-retained"/);
|
|
assert.match(vaultViewLayoutSource, /currentSection !== "notes" && "hidden"/);
|
|
assert.doesNotMatch(vaultViewLayoutSource, /currentSection === "notes" && \(\s*<NotesManager/);
|
|
});
|
|
|
|
test("vault header collapsed actions cannot retain hidden focus", () => {
|
|
assert.match(vaultViewLayoutSource, /newHostActionsRef\.current\?\.contains\(activeElement\)/);
|
|
assert.match(vaultViewLayoutSource, /sessionActionsRef\.current\?\.contains\(activeElement\)/);
|
|
assert.match(vaultViewLayoutSource, /activeElement\.blur\(\)/);
|
|
assert.match(vaultViewLayoutSource, /aria-hidden=\{isHostPanelOpen \? true : undefined\}/);
|
|
assert.match(vaultViewLayoutSource, /inert=\{isHostPanelOpen \? true : undefined\}/);
|
|
});
|
|
|
|
test("vault sidebar toggle keeps an accessible action label", () => {
|
|
assert.match(
|
|
vaultViewLayoutSource,
|
|
/aria-label=\{sidebarCollapsed \? t\("vault\.sidebar\.expand"\) : t\("vault\.sidebar\.collapse"\)\}/,
|
|
);
|
|
});
|
|
|
|
test("keychain deletion clears the remembered passphrase through the vault handler", () => {
|
|
assert.match(vaultViewLayoutSource, /const handleDeleteVaultKey = React\.useCallback/);
|
|
assert.match(vaultViewLayoutSource, /void deleteVaultKey\(\{/);
|
|
assert.match(vaultViewLayoutSource, /onDelete=\{handleDeleteVaultKey\}/);
|
|
});
|
|
|
|
test("plugin importer merge and commit workflow is owned by application state", () => {
|
|
assert.match(vaultViewLayoutSource, /usePluginImporterCommit\(\{/);
|
|
assert.doesNotMatch(vaultViewLayoutSource, /normalizePluginImporterRecords|mergePluginImporterDrafts|buildPluginImporterSafePreview/);
|
|
assert.match(pluginImporterCommitHookSource, /normalizePluginImporterRecords/);
|
|
assert.match(pluginImporterCommitHookSource, /mergePluginImporterDrafts/);
|
|
assert.match(pluginImporterCommitHookSource, /buildPluginImporterSafePreview/);
|
|
});
|
|
|
|
test("Vault import entry is disabled while an import is running", () => {
|
|
assert.match(vaultViewLayoutSource, /disabled=\{importProgress\?\.status === "running"\}/);
|
|
assert.match(vaultViewLayoutSource, /if \(importProgress\?\.status === "running"\) return;/);
|
|
});
|