@Test public void shouldRequireLayoutAfterConsumableSizeChanges() throws Exception { FakeScene root = new FakeScene(); root.add(panel); panel.getRoot(); panel.resetLayout(); panel.consumableAreaChanged(); assertEquals(true, panel.needsLayout()); }
@Before public void setUp() { assumeTrue(TestUtil.notHeadless()); root = new FakeScene(); panel = new MockTextInputPanel(); parent = new PropPanel(new FakePropProxy()); parent.add(panel); root.add(parent); stage = new MockStage(); root.setStage(stage); model = panel.getModel(); model.setText("Some Text"); }
@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()); }