@Test public void consumedCharTypedEventsDoNothing() throws Exception { panel = new TextBoxPanel(); root.add(panel); panel.getModel().setText("Some Text"); new CharTypedEvent(0, 'A').consumed().dispatch(panel); assertEquals("Some Text", panel.getText()); }
@Test public void consumedKeyPressEventsDoNothing() throws Exception { panel = new TextBoxPanel(); root.add(panel); panel.getModel().setText("Some Text"); new KeyPressedEvent(0, KeyEvent.KEY_BACK_SPACE, 0).consumed().dispatch(panel); assertEquals("Some Text", panel.getText()); }