MCPcopy
hub / github.com/jcubic/jquery.terminal / test_click

Function test_click

__tests__/terminal.spec.js:4079–4092  ·  view source on GitHub ↗
(spec)

Source from the content-addressed store, hash-verified

4077 });
4078 });
4079 function test_click(spec) {
4080 var input_str = spec[0];
4081 var output_str = spec[1];
4082 term.set_command(input_str).focus();
4083 for (var pos = 0, len = $.terminal.length(input_str); pos < len; ++pos) {
4084 var node = cmd.find('.cmd-wrapper div span[data-text]').eq(pos);
4085 click(node);
4086 expect(cmd.display_position()).toBe(pos);
4087 var output = cmd.find('[role="presentation"]').map(function() {
4088 return $(this).text().replace(/\xA0/g, ' ');
4089 }).get().join('\n');
4090 expect([pos, output]).toEqual([pos, output_str]);
4091 }
4092 }
4093 it('should move cursor when over formatting', without_formatters(function() {
4094 false && ($.terminal.defaults.formatters = [
4095 function(string, options) {

Callers 1

terminal.spec.jsFile · 0.85

Calls 8

$Function · 0.85
focusMethod · 0.80
set_commandMethod · 0.80
display_positionMethod · 0.80
clickFunction · 0.70
lengthMethod · 0.65
getMethod · 0.65
mapMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…