Browse Source

test_testEmojiPickerActionListenerFunctionality

remotes/origin/client-handler
Valentin Spiroski 11 months ago
parent
commit
12c80a6668
  1. 22
      src/test/java/TestEmojiPicker.java

22
src/test/java/TestEmojiPicker.java

@ -70,4 +70,24 @@ public class TestEmojiPicker {
} }
} }
}
@Test
public void testEmojiPickerActionListenerFunctionality() {
JTextField textField = new JTextField();
EmojiPicker emojiPicker = new EmojiPicker(textField);
Component[] components = emojiPicker.getComponents();
for (Component component : components) {
assertTrue(component instanceof JButton);
JButton button = (JButton) component;
EmojiPicker.EmojiActionListener actionListener = (EmojiPicker.EmojiActionListener) button.getActionListeners()[0];
assertNotNull(actionListener);
actionListener.actionPerformed(null);
assertEquals(button.getText(), textField.getText());
}
}
}
Loading…
Cancel
Save