Skip to content

Commit

Permalink
Test deleting newline and then inserting.
Browse files Browse the repository at this point in the history
This is currently failing in Firefox.
  • Loading branch information
byronm committed Jul 24, 2013
1 parent 0ab7000 commit 418e0d5
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/webdriver/unit/delete.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,25 @@ def run_delete_test(initial, delete_delta, err_msg)
run_delete_test initial, delta, "Failed deleting formatted, newlined text."
end

it "should delete newline from empty document" do
initial = { "startLength" => 0,
"endLength" => 1,
"ops" => [{ "value" => "\n"}]
}

reset_scribe initial
@editor.send_keys :enter
@editor.send_keys :backspace
@editor.send_keys "a"
expected = { "startLength" => 0,
"endLength" => 2,
"ops" => [{ "value" => "a\n", "attributes" => {} }]
}
assert ScribeDriver::JS.editor_delta_equals(expected),
"Deleting a newline and then inserting into the empty document fails."

end

it "should pull formatting onto previous line when newline is deleted" do
initial = { "startLength" => 0,
"endLength" => 10,
Expand Down

0 comments on commit 418e0d5

Please sign in to comment.