mirror of
https://github.com/arduino/Arduino.git
synced 2024-12-04 15:24:12 +01:00
af1828a00a
- refactored to execute GUI code in swing thread - added failing test the check escape keypress behaviour con save/close modal dialog see #1279
40 lines
1.1 KiB
Java
40 lines
1.1 KiB
Java
package processing.app;
|
|
|
|
import org.fest.swing.fixture.JMenuItemFixture;
|
|
import org.junit.Test;
|
|
import processing.app.helpers.JEditTextAreaFixture;
|
|
import processing.app.syntax.JEditTextArea;
|
|
|
|
import static org.junit.Assert.assertEquals;
|
|
|
|
public class ReplacingTextGeneratesTwoUndoActionsTest extends AbstractGUITest {
|
|
|
|
@Test
|
|
public void shouldUndoAndRedo() throws Exception {
|
|
JMenuItemFixture menuEditUndo = window.menuItem("menuEditUndo");
|
|
menuEditUndo.requireDisabled();
|
|
JMenuItemFixture menuEditRedo = window.menuItem("menuEditRedo");
|
|
menuEditRedo.requireDisabled();
|
|
|
|
JEditTextAreaFixture jEditTextArea = window.jEditTextArea("editor");
|
|
|
|
jEditTextArea.setText("fake text");
|
|
|
|
menuEditUndo.requireEnabled();
|
|
menuEditUndo.click();
|
|
|
|
assertEquals("", jEditTextArea.getText());
|
|
|
|
menuEditRedo.requireEnabled();
|
|
menuEditRedo.click();
|
|
|
|
//assertEquals("fake text", jEditTextArea.getText());
|
|
|
|
menuEditUndo.requireEnabled();
|
|
menuEditUndo.click();
|
|
menuEditUndo.click();
|
|
menuEditUndo.requireDisabled();
|
|
menuEditRedo.requireEnabled();
|
|
}
|
|
}
|