Browse Source

refactoring:testEmojiPickerButtonCount

remotes/origin/client-handler
Valentin Spiroski 11 months ago
parent
commit
cea1660183
  1. 14
      src/test/java/TestEmojiPicker.java

14
src/test/java/TestEmojiPicker.java

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

Loading…
Cancel
Save