|
@ -19,16 +19,18 @@ public class TestEmojiPicker { |
|
|
assertNotNull(emojiPicker); |
|
|
assertNotNull(emojiPicker); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
//Test to verify the correct number of emoji buttons in the EmojiPicker |
|
|
@Test |
|
|
@Test |
|
|
public void testEmojiPickerButtonCount() { |
|
|
public void testEmojiPickerButtonCount() { |
|
|
|
|
|
// Arrange |
|
|
JTextField textField = new JTextField(); |
|
|
JTextField textField = new JTextField(); |
|
|
|
|
|
|
|
|
EmojiPicker emojiPicker = new EmojiPicker(textField); |
|
|
EmojiPicker emojiPicker = new EmojiPicker(textField); |
|
|
|
|
|
|
|
|
|
|
|
// Act |
|
|
Component[] components = emojiPicker.getComponents(); |
|
|
Component[] components = emojiPicker.getComponents(); |
|
|
|
|
|
|
|
|
assertEquals(12, components.length); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Assert |
|
|
|
|
|
assertEquals(12, components.length); // 12 buttons for 12 emojis |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|