|
25 | 25 | import org.testfx.api.FxRobot; |
26 | 26 | import org.testfx.framework.junit5.ApplicationExtension; |
27 | 27 | import org.testfx.framework.junit5.Start; |
| 28 | +import org.testfx.matcher.control.LabeledMatchers; |
28 | 29 | import org.testfx.matcher.control.TextInputControlMatchers; |
29 | 30 |
|
30 | 31 | import java.io.File; |
@@ -82,12 +83,15 @@ void testEnteringAcceptableValuesIntoActionEditor(FxRobot robot) throws Interrup |
82 | 83 | writeIntoFunctionFieldAndVerifyOK(robot, "öôóòLatin"); |
83 | 84 | writeIntoFunctionFieldAndVerifyOK(robot, "onChange"); |
84 | 85 |
|
| 86 | + writeIntoField(robot, "nameField", "%menu.item.name"); |
| 87 | + verifyThat("#nameTranslation", LabeledMatchers.hasText("hello world")); |
| 88 | + |
85 | 89 | verifyThatThereAreNoErrorsReported(); |
86 | 90 |
|
87 | 91 | ArgumentCaptor<MenuItem> captor = ArgumentCaptor.forClass(MenuItem.class); |
88 | 92 | verify(mockedConsumer, atLeastOnce()).accept(isA(ActionMenuItem.class), captor.capture()); |
89 | 93 | assertEquals(-1, captor.getValue().getEepromAddress()); |
90 | | - assertEquals("One Shot", captor.getValue().getName()); |
| 94 | + assertEquals("%menu.item.name", captor.getValue().getName()); |
91 | 95 | assertEquals("onChange", captor.getValue().getFunctionName()); |
92 | 96 | } |
93 | 97 |
|
@@ -163,6 +167,9 @@ void testEnteringBadValuesIntoBaseEditor(FxRobot robot) throws InterruptedExcept |
163 | 167 | tryToEnterBadValueIntoField(robot, "nameField", "variableField", "", |
164 | 168 | "Name: field must be populated"); |
165 | 169 |
|
| 170 | + tryToEnterBadValueIntoField(robot, "nameField", "variableField", "%unknown", |
| 171 | + "WARNING Name: no locale entry in bundle"); |
| 172 | + |
166 | 173 | tryToEnterBadValueIntoField(robot, "functionNameTextField", "variableField", "name spaces", |
167 | 174 | "Field must use only letters, digits, and '_'"); |
168 | 175 |
|
|
0 commit comments