open-nomad/ui/tests
Buck Doyle fbe40a5d36
UI: add handling for exec command-editing keys (#7601)
This is a minimal implementation that closes #7463. It doesn’t include
true support for moving around within the command to edit using arrow
keys because it gets too complex when managing wrapping at the edge of
the terminal. Instead, arrow keys are ignored. It also ignores ^A and
^E, which are cursor manipulations that pose similar problems to arrow
keys. It does support ^U, which deletes the entire command.

It also allows a command to be pasted, which was previously unsupported.
This is accomplished by migrating from Xterm.js’s onKey handler to
onData, which is recommended here:
https://github.com/xtermjs/xterm.js/issues/2673#issuecomment-574897733

onData is a higher-level handler that issues events with the final
interpreted data instead of the individual key events. That means the
processing in this PR has changed from inspecting DOM key events to
inspecting their ASCII equivalents, which I’ve extracted into a utility
dictionary for use in tests and implementation.

One consequence of ignoring most control characters is that if you paste
a string that includes a control character, that character will be
stripped. It’s somewhat strange for compound sequences like arrow keys; 
if you run copy('/bin/b' + '\x1b[D' + 'ash') in a Javascript console and
paste what’s on the clipboard, you get "/bin/b[Dash". That’s because
the left arrow key, as in that centre portion of the string,
is represented by the escape character and a coded sequence. Stripping
the control character leaves the coded sequence as part of the paste.
That seems like an acceptable compromise vs either ignoring any pasted
string with control characters (confusing UX) or trying to interpret and
strip all such compound control sequences (difficult to be exhaustive).
2020-04-03 12:14:47 -05:00
..
acceptance UI: add handling for exec command-editing keys (#7601) 2020-04-03 12:14:47 -05:00
helpers Refactor ability tests to use a setup hook for ability lookup 2020-01-30 21:29:21 -08:00
integration UI: add handling for exec command-editing keys (#7601) 2020-04-03 12:14:47 -05:00
pages Tests for the new volumes facet 2020-03-30 17:33:46 -07:00
unit Fix flaky serializer test 2020-04-01 14:54:05 -07:00
utils Add tests for findAll store culling 2018-03-02 16:21:37 -08:00
.eslintrc.js New test helper for getting the underlying CodeMirror instance from a dom selector 2018-08-16 10:56:37 -07:00
index.html Update the test index.html file 2019-04-10 14:54:32 -07:00
test-helper.js Update test-helper to new testing style 2019-04-10 14:54:32 -07:00