Skip to content

update the tests #136

@thanos

Description

@thanos

6. Tests

live_editor_component_test.exs

Update the default debounce assertion from data-debounce="300" to data-debounce="50".

live_editor_event_test.exs

Add tests for the diff handler and apply_diff:

describe "diff event handling" do
  # Test handle_event("diff", ...) with a mounted component
  test "applies single character insertion"
  test "applies deletion"
  test "silently ignores out-of-bounds diff"
end

editor.ex tests (existing file)

Add unit tests for ExEditor.Editor.apply_diff/4:

  • Insert at start, middle, end
  • Delete (empty replacement text)
  • Replace range
  • Out-of-bounds positions return {:error, :out_of_bounds}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions