Skip to content

Fix 22 test failures from recent schema and browser test work #406

Closed

Description

@malibio

Problem

22 tests are currently failing across frontend and backend. These represent regressions introduced by recent feature work (schema management, browser test additions, index manager changes).

UPDATE: Now tracking 23 failures (added - SQL parameter error discovered during issue #398 investigation).

Failing Tests Summary

Frontend: 11 failures
Backend: 12 failures (updated from 11)
Total: 23 failures (updated from 22)


Frontend Failures (11 tests)

Browser Positioning Tests (4 failures)

Location: packages/desktop-app/src/tests/browser/

  1. autocomplete-interaction.test.ts - "verifies getBoundingClientRect returns real dimensions"
  2. autocomplete-interaction.test.ts - "can calculate dropdown position relative to cursor"
  3. slash-dropdown-interaction.test.ts - "verifies getBoundingClientRect for dropdown positioning"
  4. slash-dropdown-interaction.test.ts - "can calculate cursor position for dropdown placement"

Error Pattern:

AssertionError: expected 0 to be greater than 0

Root Cause: getBoundingClientRect() returns 0 dimensions in browser test environment.


Textarea Controller Tests (6 failures)

Location: packages/desktop-app/src/tests/components/textarea-controller.test.ts

  1. "should handle Enter key for new node creation"
  2. "should handle Tab key for indentation"
  3. "should handle Shift+Tab for outdentation"
  4. "should handle Cmd+B for bold formatting"
  5. "should handle Cmd+I for italic formatting"
  6. "should handle Ctrl+B for bold formatting (cross-platform)"

Error Patterns:

AssertionError: Target cannot be null or undefined
AssertionError: expected 'text' to be '**text**'

Root Cause: Keyboard event handling or command registry broken in recent changes.


Tab Persistence Test (1 failure)

Location: packages/desktop-app/src/tests/services/tab-persistence-service.test.ts

  1. "clears pending save timer"

Error Pattern:

AssertionError: expected "setItem" to not be called at all, but actually been called 1 times

Root Cause: Flush timing issue or test expectation incorrect.


Backend Failures (12 tests - updated)

Index Manager Tests (6 failures)

Location: packages/core/src/db/index_manager.rs

  1. test_index_idempotency
  2. test_create_json_path_index
  3. test_list_indexes
  4. test_index_isolation_by_type
  5. test_sql_injection_prevention_create_index
  6. test_sql_injection_prevention_list_indexes

Root Cause: Likely introduced by recent schema service or database changes.


MCP Handler Tests (4 failures - updated)

Location: packages/core/src/mcp/handlers/nodes_test.rs

  1. test_get_nodes_batch_with_not_found
  2. test_concurrent_update_version_conflict
  3. test_get_children_ordered_with_multiple_insertions
  4. test_move_child_to_index_beyond_sibling_count (NEW - added during Investigate SIGABRT/SIGTRAP crash when running full Rust test suite #398 investigation)

Error (new test #4):

MCPError { code: -32603, message: "Operation error: Service error: Query failed: Failed to prepare mentions query: SQLite failure: `bad parameter or other API misuse`" }

Root Cause (new test #4): SQL parameter binding error in mention service query logic. Discovered during SIGABRT crash investigation (#398).

Root Cause (tests 1-3): May be related to OCC or batch operation changes.


Performance Test (1 failure)

Location: packages/core/src/mcp/handlers/nodes_test.rs

  1. test_occ_performance_overhead

Error: Performance exceeds threshold (6.56ms average vs 5ms target).

Root Cause: Flaky performance test - depends on system load and timing conditions.


Container Detection Test (1 failure)

Location: packages/core/src/services/node_service_container_test.rs

  1. test_container_detection_is_null_based_not_type_based

Error: Required field 'status' is missing from task node

Root Cause: Test needs updating for schema validation requirements (task nodes now require status field).


Reproduction

Frontend

bun run test
# 11 failures in browser tests and textarea-controller

Backend

cargo test --lib -p nodespace-core -- --test-threads=4
# 12 failures (11 original + 1 SQL parameter error)

Acceptance Criteria

  • All 23 failing tests pass (updated from 22)
  • Root cause documented for each category of failures
  • No new test failures introduced
  • Browser positioning tests work in Vitest Browser Mode
  • Textarea controller keyboard handling restored
  • Index manager tests pass with current schema implementation
  • SQL parameter binding fixed in mention service (new)
  • All tests pass: bun run test && cargo test --lib -p nodespace-core -- --test-threads=4

Context

These failures were introduced by recent feature work:

All tests were passing before these changes, indicating regressions that need investigation.


Related Issues


Priority

🔴 HIGH - Failing tests indicate regressions and reduce confidence in codebase.


Technical Specifications

Reference Files

Frontend:

  • packages/desktop-app/src/tests/browser/autocomplete-interaction.test.ts
  • packages/desktop-app/src/tests/browser/slash-dropdown-interaction.test.ts
  • packages/desktop-app/src/tests/components/textarea-controller.test.ts
  • packages/desktop-app/src/tests/services/tab-persistence-service.test.ts

Backend:

  • packages/core/src/db/index_manager.rs
  • packages/core/src/mcp/handlers/nodes_test.rs (includes new SQL parameter error)
  • packages/core/src/services/node_service_container_test.rs

Activity

  1. added
    bug
    on Nov 4, 2025
  2. self-assigned this
    on Nov 4, 2025
  3. added 2 commits that reference this issue on Nov 4, 2025
    8c4f2be
    554f327
  4. added 2 commits that reference this issue on Feb 4, 2026
    cef663c
    7a44a3a
  5. added a commit that references this issue on Feb 26, 2026
    5704d16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

backendbugfrontendtesting

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions