Skip to content

Commit

Permalink
Merge pull request #268 from seandias/Listing_Features
Browse files Browse the repository at this point in the history
Add commands to ChatWindow.java.
  • Loading branch information
e1121208 authored Nov 7, 2024
2 parents 1561cd6 + 3bc9ebe commit ad928f6
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/java/seedu/address/ui/ChatWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,11 @@ public String getResponse(String message) {
+ "Command: moreinfo {name}\n"
+ "Example: moreinfo Amy\n"
+ "Opens a window displaying detailed information about the specified client.";
} else if (Pattern.compile("\\b(c+l+e+a+r+|reset|wipe)\\b").matcher(message).find()) {
return "It seems you want to clear some data.\n"
+ "Can you specify which you are referring to?\n"
+ "• Clear all client data and listings - clear\n"
+ "• Clear only listings - clearlistings";
} else if (Pattern.compile("\\bh+e+l+p+\\b").matcher(message).find()) {
return "Sure! What do you need help with?";
} else {
Expand Down
22 changes: 22 additions & 0 deletions src/test/java/seedu/address/ui/ChatWindowUiTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,28 @@ public void getResponse_moreInfo_success() {

@Test
@Order(32)
public void getResponse_clearCommandSuggestions_success() {
assertEquals("It seems you want to clear some data.\n"
+ "Can you specify which you are referring to?\n"
+ "• Clear all client data and listings - clear\n"
+ "• Clear only listings - clearlistings",
chatWindow.getResponse("clear"));

assertEquals("It seems you want to clear some data.\n"
+ "Can you specify which you are referring to?\n"
+ "• Clear all client data and listings - clear\n"
+ "• Clear only listings - clearlistings",
chatWindow.getResponse("reset all"));

assertEquals("It seems you want to clear some data.\n"
+ "Can you specify which you are referring to?\n"
+ "• Clear all client data and listings - clear\n"
+ "• Clear only listings - clearlistings",
chatWindow.getResponse("wipe listings"));
}

@Test
@Order(33)
public void handleSendButtonAction_exitOnGoodbye_success() {
FxRobot robot = new FxRobot();
robot.clickOn(userInput);
Expand Down

0 comments on commit ad928f6

Please sign in to comment.