more decoupling editor tests from App

This commit is contained in:
Kartik K. Agaram 2022-07-16 08:27:11 -07:00
parent 51b4efa59a
commit a2b654b534

View File

@ -478,7 +478,7 @@ function test_select_text()
App.fake_key_press('lshift')
edit.run_after_keychord(Editor_state, 'S-right')
App.fake_key_release('lshift')
App.keyreleased('lshift')
edit.key_released(Editor_state, 'lshift')
-- selection persists even after shift is released
check_eq(Editor_state.selection1.line, 1, 'F - test_select_text/selection:line')
check_eq(Editor_state.selection1.pos, 1, 'F - test_select_text/selection:pos')
@ -534,9 +534,9 @@ function test_edit_with_shift_key_deletes_selection()
edit.draw(Editor_state)
-- mimic precise keypresses for a capital letter
App.fake_key_press('lshift')
App.keypressed('d')
edit.keychord_pressed(Editor_state, 'd', 'd')
App.textinput('D')
App.keyreleased('d')
edit.key_released(Editor_state, 'd')
App.fake_key_release('lshift')
-- selected text is deleted and replaced with the key
check_nil(Editor_state.selection1.line, 'F - test_edit_with_shift_key_deletes_selection')