Skip to content

Commit b53ce59

Browse files
committed
Add a bunch of missing tests
- Also instruct agents to not skip adding them in the future.
1 parent aff2046 commit b53ce59

File tree

13 files changed

+1531
-47
lines changed

13 files changed

+1531
-47
lines changed

AGENTS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,10 @@ There are two MCP servers available to you:
100100
- When writing CSS, ALWAYS use variables defined in `apps/desktop/src/app.css`. Stylelint catches
101101
undefined/hallucinated CSS variables.
102102
- Always cover your code with tests until you're confident in your implementation!
103+
- **Coverage allowlist is a last resort.** There's no point in testing wiring, that's for sure. But in the case of real
104+
logic, extract pure functions to a `.ts` file and test them. Only allowlist what can't be tested (Tauri IPC wrappers,
105+
DOM-only code, pure UI components with no logic). Name the specific untestable API calls in the reason.
106+
"Depends on Tauri" isn't enough.
103107
- When adding new code that loads remote content (like `fetch` from external URLs or `iframe`), always ask the user
104108
whether to **disable** that functionality in dev mode, and use static/mock data instead. It's because we use
105109
`withGlobalTauri: true` in dev mode for MCP Server Tauri, which is a security risk.

apps/desktop/coverage-allowlist.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
"$comment": "Files listed here are exempt from coverage thresholds. Each entry should include a reason. Remove entries as you add tests.",
33
"files": {
44
"accent-color.ts": { "reason": "Depends on Tauri invoke and listen APIs" },
5+
"commands/command-registry.ts": {
6+
"reason": "95% static command definitions; filtering validated by fuzzy-search tests"
7+
},
58
"ui/AlertDialog.svelte": { "reason": "Simple UI modal for informational messages" },
69
"ui/CommandBox.svelte": { "reason": "Simple UI component, clipboard + 2s timeout" },
710
"ui/dialog-registry.ts": { "reason": "Pure constant and type definition, no logic to test" },
@@ -28,17 +31,16 @@
2831
},
2932
"file-explorer/pane/DualPaneExplorer.svelte": { "reason": "Tested in integration.test.ts, complex component" },
3033
"file-operations/mkdir/new-folder-operations.ts": { "reason": "Depends on FilePane refs and Tauri listen API" },
31-
"file-explorer/pane/sorting-handlers.ts": { "reason": "getNewSortOrder tested, rest depends on FilePane refs" },
34+
"file-explorer/pane/sorting-handlers.ts": {
35+
"reason": "applySortResult/collectSortState depend on FilePane refs; index functions tested"
36+
},
3237
"file-explorer/selection/FileIcon.svelte": { "reason": "Simple UI component, display only" },
3338
"file-explorer/pane/FilePane.svelte": { "reason": "Tested in integration.test.ts, complex component" },
3439
"file-explorer/pane/MtpConnectionView.svelte": { "reason": "MTP connection UI, depends on Tauri APIs" },
3540
"file-explorer/pane/NetworkMountView.svelte": { "reason": "Network mount UI, depends on Tauri APIs" },
3641
"file-explorer/pane/rename-flow.svelte.ts": {
3742
"reason": "Extracted from FilePane, depends on Tauri commands and rename operations"
3843
},
39-
"file-explorer/pane/selection-state.svelte.ts": {
40-
"reason": "Reactive selection state, tested via FilePane integration"
41-
},
4244
"file-explorer/views/FullList.svelte": {
4345
"reason": "Logic tested in full-list-utils.ts, component mounting heavy"
4446
},
@@ -50,7 +52,6 @@
5052
},
5153
"file-explorer/network/NetworkBrowser.svelte": { "reason": "Network component, needs Tauri integration" },
5254
"file-explorer/pane/PaneResizer.svelte": { "reason": "Mouse drag UI component, difficult to unit test" },
53-
"file-explorer/navigation/path-navigation.ts": { "reason": "Depends on Tauri pathExists command" },
5455
"file-explorer/network/NetworkLoginForm.svelte": { "reason": "Network component, needs Tauri integration" },
5556
"file-explorer/pane/PermissionDeniedPane.svelte": { "reason": "Simple UI component" },
5657
"file-explorer/pane/VolumeUnreachableBanner.svelte": {
@@ -79,8 +80,6 @@
7980
"settings/components/SettingNumberInput.svelte": { "reason": "UI component, logic is simple" },
8081
"settings/components/SettingRadioGroup.svelte": { "reason": "UI component, logic is simple" },
8182
"settings/components/SectionSummary.svelte": { "reason": "UI component, simple navigation cards" },
82-
"settings/format-utils.ts": { "reason": "Simple date formatting, low complexity" },
83-
"settings/network-settings.ts": { "reason": "Thin wrapper over getSetting, requires mocking settings store" },
8483
"settings/reactive-settings.svelte.ts": { "reason": "Svelte reactive state, depends on settings store" },
8584
"settings/settings-applier.ts": { "reason": "Depends on DOM APIs (document.documentElement.style)" },
8685
"settings/components/SettingRow.svelte": { "reason": "UI component, layout only" },
@@ -97,6 +96,9 @@
9796
"settings/sections/KeyboardShortcutsSection.svelte": {
9897
"reason": "UI section, logic tested in shortcuts/*.test.ts"
9998
},
99+
"settings/sections/LicenseSection.svelte": {
100+
"reason": "UI section, pure logic extracted to license-section-utils.ts and tested"
101+
},
100102
"settings/sections/LoggingSection.svelte": { "reason": "UI section, simple rendering" },
101103
"settings/mcp-settings-bridge.ts": { "reason": "MCP bridge, depends on Tauri APIs and events" },
102104
"settings/sections/McpServerSection.svelte": { "reason": "UI section, depends on Tauri APIs" },
@@ -107,7 +109,6 @@
107109
"settings/sections/UpdatesSection.svelte": { "reason": "UI section, simple rendering" },
108110
"settings/settings-store.ts": { "reason": "Depends on Tauri store APIs" },
109111
"settings/settings-window.ts": { "reason": "Depends on Tauri window APIs" },
110-
"shortcuts/conflict-detector.ts": { "reason": "Logic tested via shortcuts.test.ts" },
111112
"shortcuts/mcp-shortcuts-listener.ts": { "reason": "MCP listener, depends on Tauri events" },
112113
"shortcuts/keyboard-handler.ts": { "reason": "DOM event handling, tested via integration" },
113114
"shortcuts/shortcuts-store.ts": { "reason": "Depends on Tauri store APIs" },
@@ -121,7 +122,6 @@
121122
"tauri-commands/mtp.ts": { "reason": "Tauri command wrappers, tested via integration" },
122123
"tauri-commands/networking.ts": { "reason": "Tauri command wrappers, tested via integration" },
123124
"tauri-commands/settings.ts": { "reason": "Tauri command wrappers, tested via integration" },
124-
"tauri-commands/ipc-types.ts": { "reason": "Type definitions and small helpers, tested via consuming modules" },
125125
"tauri-commands/storage.ts": { "reason": "Tauri command wrappers, tested via integration" },
126126
"tauri-commands/write-operations.ts": { "reason": "Tauri command wrappers, tested via integration" },
127127
"utils/confirm-dialog.ts": { "reason": "Thin wrapper over Tauri dialog API" },

0 commit comments

Comments
 (0)