Skip to content

Commit fb38318

Browse files
javier-godoypaodb
authored andcommitted
test: add test for line wrapping
1 parent eeeb2ec commit fb38318

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/test/java/com/flowingcode/vaadin/addons/xterm/integration/ConsoleFeatureIT.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,16 @@ private String makeFullLine(XTermElement term, boolean hasPrompt) {
3535
return StringUtils.repeat("0123456789", cols / 10 + 1).substring(0, cols - x);
3636
}
3737

38+
@Test
39+
public void testWriteWrappedLine() throws InterruptedException {
40+
XTermElement term = $(XTermElement.class).first();
41+
Position home = term.cursorPosition();
42+
String text = makeFullLine(term, true) + makeFullLine(term, false);
43+
term.sendKeys(text);
44+
assertThat(term.currentLine(), is(text));
45+
assertThat(term.cursorPosition(), is(new Position(1, home.y + 1)));
46+
}
47+
3848
@Test
3949
public void testFeature() throws InterruptedException {
4050
XTermElement term = $(XTermElement.class).first();

0 commit comments

Comments
 (0)