Skip to content

Commit

Permalink
Merge pull request #221 from e1121208/improve-code-coverage-to-the-ma…
Browse files Browse the repository at this point in the history
…ximum

Improve CommandBoxUiTest test
  • Loading branch information
e1121208 authored Nov 5, 2024
2 parents 5925016 + b6e1693 commit 4a4d450
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/test/java/seedu/address/ui/CommandBoxUiTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static seedu.address.ui.CommandBox.ERROR_STYLE_CLASS;

import java.util.ArrayList;
import java.util.Arrays;
Expand Down Expand Up @@ -73,4 +75,15 @@ public void commandNavigationWorks_success() {
robot.type(KeyCode.DOWN);
}
}
@Test
public void setStyleToIndicateCommandFailure_addsErrorStyleClass() {
FxRobot robot = new FxRobot();

assertNotNull(robot.lookup("#commandTextField"), "Command box should be present.");
robot.clickOn("#commandTextField");
robot.write("UNKNOWN COMMMAND");
robot.type(KeyCode.ENTER);
assertTrue(robot.lookup("#commandTextField").query().getStyleClass().contains(ERROR_STYLE_CLASS));
}

}

0 comments on commit 4a4d450

Please sign in to comment.