diff --git a/src/main/java/seedu/address/ui/ChatWindow.java b/src/main/java/seedu/address/ui/ChatWindow.java index 450fb99dc21..5a044704203 100644 --- a/src/main/java/seedu/address/ui/ChatWindow.java +++ b/src/main/java/seedu/address/ui/ChatWindow.java @@ -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 { diff --git a/src/test/java/seedu/address/ui/ChatWindowUiTest.java b/src/test/java/seedu/address/ui/ChatWindowUiTest.java index d1a98d5caf7..92608800921 100644 --- a/src/test/java/seedu/address/ui/ChatWindowUiTest.java +++ b/src/test/java/seedu/address/ui/ChatWindowUiTest.java @@ -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);