Skip to content

Fix Backspace/Delete Operations (9 test failures) #229

Closed

Description

@malibio

Bug: Backspace/Delete Operations Failures

Related to: Issue #208 (Comprehensive Test Coverage)
Test File: src/tests/integration/backspace-operations.test.ts
Failures: 9/10 tests failing

⚠️ Prerequisites

Must complete Issue #245 first (test infrastructure fix)

The PersistenceCoordinator setup will help isolate which failures are real bugs vs infrastructure issues (race conditions, database locking).

Note: Issue #230 (dev1) has already fixed combineNodes() race condition. Remaining failures in this issue may be related or separate bugs.


Problem

The comprehensive tests have exposed bugs in backspace/delete operations:

  • Node combining not working correctly
  • Content preservation issues when merging
  • Cursor positioning at merge junction incorrect
  • Sibling chain repairs failing
  • Children promotion not working
  • Event emissions missing

Failing Tests

  1. should combine two text nodes and preserve content
  2. should position cursor at junction point when combining
  3. should strip formatting from current node when combining
  4. should promote children when combining nodes with children
  5. should repair sibling chain after combining
  6. should handle combining nodes with nested children
  7. should emit correct events when combining
  8. should handle combining when previous node is at different depth
  9. should strip task checkbox formatting when combining

Acceptance Criteria

  • All 9 tests pass
  • Content merging works correctly
  • Cursor positioning accurate
  • Children properly promoted
  • Sibling chain maintained

Testing

Run: bun run test src/tests/integration/backspace-operations.test.ts

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions