From 37f5315464c13e462e0c49e460aced1909272836 Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Wed, 27 Feb 2013 17:10:46 +0100 Subject: [PATCH] Added test for GUI (Reduce Indent) --- .../ReduceIndentWith1CharOnLastLineTest.java | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 app/test/processing/app/ReduceIndentWith1CharOnLastLineTest.java diff --git a/app/test/processing/app/ReduceIndentWith1CharOnLastLineTest.java b/app/test/processing/app/ReduceIndentWith1CharOnLastLineTest.java new file mode 100644 index 000000000..9ee7e0c50 --- /dev/null +++ b/app/test/processing/app/ReduceIndentWith1CharOnLastLineTest.java @@ -0,0 +1,28 @@ +package processing.app; + +import static org.junit.Assert.assertEquals; + +import org.fest.swing.fixture.JMenuItemFixture; +import org.junit.Test; + +import processing.app.helpers.JEditTextAreaFixture; + +public class ReduceIndentWith1CharOnLastLineTest extends AbstractGUITest { + + @Test + public void shouldJustCloseTheDialog() throws Exception { + JMenuItemFixture menuDecreaseIndent = window.menuItem("menuDecreaseIndent"); + + JEditTextAreaFixture editor = window.jEditTextArea("editor"); + editor.setText("void loop()\n{\n Serial.begin(9600)\n}"); + + editor.selectAll(); + + menuDecreaseIndent.requireEnabled(); + menuDecreaseIndent.click(); + + EditorConsole console = (EditorConsole) window.scrollPane("console").component(); + + assertEquals("", console.consoleDoc.getText(0, console.consoleDoc.getLength())); + } +}