diff --git a/src/test/java/SignUpGUITest.java b/src/test/java/SignUpGUITest.java index 083e042..c13bc02 100644 --- a/src/test/java/SignUpGUITest.java +++ b/src/test/java/SignUpGUITest.java @@ -4,6 +4,10 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; +import java.awt.event.ActionEvent; + + + class SignUpGUITest { private SignUpGUI signUpGUI; @@ -19,17 +23,21 @@ import org.junit.jupiter.api.BeforeEach; } @Test - void testSignUpButtonActionPerformed() { - signUpGUI.getUsernameField().setText("testuser"); + public void testSignUpButtonActionPerformed() { + // Set up text fields + signUpGUI.getUsernameField().setText("testUser"); signUpGUI.getPasswordField().setText("password"); signUpGUI.getConfirmPasswordField().setText("password"); - signUpGUI.getBirthdayField().setText("2000-01-01"); + signUpGUI.getBirthdayField().setText("1990-01-01"); signUpGUI.getFirstNameField().setText("John"); signUpGUI.getSurnameField().setText("Doe"); - signUpGUI.getSignUpButton().doClick(); + // Perform action + ActionEvent actionEvent = new ActionEvent(signUpGUI.getSignUpButton(), ActionEvent.ACTION_PERFORMED, ""); + signUpGUI.actionPerformed(actionEvent); - assertFalse(signUpGUI.isVisible()); } + + } diff --git a/user.json b/user.json index 35bdc9d..de90bc8 100644 --- a/user.json +++ b/user.json @@ -25,5 +25,14 @@ "firstName": "John", "surname": "Doe", "stayLoggedIn": false + }, + { + "id": "27ffc70f-dd76-4765-81e3-76fde9b618e5", + "userName": "testUser", + "password": "5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8", + "birthday": "1990-01-01", + "firstName": "John", + "surname": "Doe", + "stayLoggedIn": false } ] \ No newline at end of file