generated from nhcarrigan/template
test: add comprehensive test coverage for CLI parsing and core modules
Added 30 new backend tests for improved code coverage: **New Test Modules:** - debug_logger.rs (6 tests): Event creation, serialization, unicode support - bridge_manager.rs (12 tests): Initialization, error handling, conversation management - notifications.rs (12 tests): PowerShell script generation, quote escaping, formatting **Enhanced Test Coverage:** - commands.rs: Added 9 edge case tests for CLI parsing - Unicode support (Japanese, emoji) in plugins/marketplaces/servers - Missing field handling (plugins without version/status) - Extra whitespace robustness - Very long command lines - Multiple servers with "Checking..." headers **Test Results:** - Backend: 408 tests passing (up from 378) - Frontend: 363 tests passing - Total: 771 comprehensive tests - Coverage: ~60% backend (excellent for testable business logic) **Testing Improvements:** - Extracted testable functions from command handlers - Golden files approach for CLI output parsing - Comprehensive edge case coverage (unicode, special chars, empty values) - Fixed clippy warnings (boolean assertions) All business logic, parsing, serialization, and error handling now comprehensively tested. Co-Authored-By: Naomi Carrigan <commits@nhcarrigan.com>
This commit is contained in:
@@ -184,7 +184,9 @@
|
||||
|
||||
<!-- Add Server Form -->
|
||||
{#if showAddForm}
|
||||
<div class="mx-4 mt-4 p-4 bg-[var(--bg-secondary)]/50 border border-[var(--border-color)] rounded-lg">
|
||||
<div
|
||||
class="mx-4 mt-4 p-4 bg-[var(--bg-secondary)]/50 border border-[var(--border-color)] rounded-lg"
|
||||
>
|
||||
<h3 class="text-sm font-medium text-[var(--text-primary)] mb-3">Add MCP Server</h3>
|
||||
<div class="space-y-3">
|
||||
<div>
|
||||
@@ -311,7 +313,9 @@
|
||||
|
||||
<!-- Server Details Panel -->
|
||||
{#if selectedServer}
|
||||
<div class="w-80 bg-[var(--bg-secondary)]/50 rounded-lg p-4 border border-[var(--border-color)]">
|
||||
<div
|
||||
class="w-80 bg-[var(--bg-secondary)]/50 rounded-lg p-4 border border-[var(--border-color)]"
|
||||
>
|
||||
<h3 class="text-lg font-semibold text-[var(--text-primary)] mb-4">Server Details</h3>
|
||||
|
||||
{#if isLoadingDetails}
|
||||
@@ -376,7 +380,11 @@
|
||||
>Environment</label
|
||||
>
|
||||
<pre
|
||||
class="text-xs text-[var(--text-primary)] mt-1 font-mono bg-[var(--bg-primary)] p-2 rounded border border-[var(--border-color)] overflow-x-auto">{JSON.stringify(selectedServer.env, null, 2)}</pre>
|
||||
class="text-xs text-[var(--text-primary)] mt-1 font-mono bg-[var(--bg-primary)] p-2 rounded border border-[var(--border-color)] overflow-x-auto">{JSON.stringify(
|
||||
selectedServer.env,
|
||||
null,
|
||||
2
|
||||
)}</pre>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
|
||||
@@ -47,12 +47,7 @@
|
||||
width="14"
|
||||
height="14"
|
||||
>
|
||||
<path
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
stroke-width="2"
|
||||
d="M19 9l-7 7-7-7"
|
||||
/>
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7" />
|
||||
</svg>
|
||||
</button>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user