From bb96e3c88c171bc978a79e39466849e272cbbafe Mon Sep 17 00:00:00 2001 From: Tan Wang Leng Date: Sun, 28 Jan 2018 17:16:35 +0800 Subject: [PATCH 1/5] CommandBox: Store result's success status in NewResultAvailableEvent NewResultAvailableEvent only stores the message of the command execution. It does not store the success status. Subscribers such as ResultDisplay requires the success status to work. As part of teaching ResultDisplay to update the display according to the success status, let's modify NewResultAvailableEvent to store the success status. --- .../address/commons/events/ui/NewResultAvailableEvent.java | 4 +++- src/main/java/seedu/address/ui/CommandBox.java | 4 ++-- src/test/java/seedu/address/ui/ResultDisplayTest.java | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main/java/seedu/address/commons/events/ui/NewResultAvailableEvent.java b/src/main/java/seedu/address/commons/events/ui/NewResultAvailableEvent.java index a6d5274a97e0..ba21c7ce38ce 100644 --- a/src/main/java/seedu/address/commons/events/ui/NewResultAvailableEvent.java +++ b/src/main/java/seedu/address/commons/events/ui/NewResultAvailableEvent.java @@ -8,9 +8,11 @@ public class NewResultAvailableEvent extends BaseEvent { public final String message; + public final boolean isSuccessful; - public NewResultAvailableEvent(String message) { + public NewResultAvailableEvent(String message, boolean isSuccessful) { this.message = message; + this.isSuccessful = isSuccessful; } @Override diff --git a/src/main/java/seedu/address/ui/CommandBox.java b/src/main/java/seedu/address/ui/CommandBox.java index 3d7aaded5640..eb931ecaa22f 100644 --- a/src/main/java/seedu/address/ui/CommandBox.java +++ b/src/main/java/seedu/address/ui/CommandBox.java @@ -107,14 +107,14 @@ private void handleCommandEntered() { // process result of the command commandTextField.setText(""); logger.info("Result: " + commandResult.feedbackToUser); - raise(new NewResultAvailableEvent(commandResult.feedbackToUser)); + raise(new NewResultAvailableEvent(commandResult.feedbackToUser, true)); } catch (CommandException | ParseException e) { initHistory(); // handle command failure setStyleToIndicateCommandFailure(); logger.info("Invalid command: " + commandTextField.getText()); - raise(new NewResultAvailableEvent(e.getMessage())); + raise(new NewResultAvailableEvent(e.getMessage(), false)); } } diff --git a/src/test/java/seedu/address/ui/ResultDisplayTest.java b/src/test/java/seedu/address/ui/ResultDisplayTest.java index acea62615ff4..e1825840c0e2 100644 --- a/src/test/java/seedu/address/ui/ResultDisplayTest.java +++ b/src/test/java/seedu/address/ui/ResultDisplayTest.java @@ -11,7 +11,8 @@ public class ResultDisplayTest extends GuiUnitTest { - private static final NewResultAvailableEvent NEW_RESULT_EVENT_STUB = new NewResultAvailableEvent("Stub"); + private static final NewResultAvailableEvent NEW_RESULT_EVENT_STUB = + new NewResultAvailableEvent("Stub", true); private ResultDisplayHandle resultDisplayHandle; From 5ef56c5be8f3b503c91ae3d3f31e138a4a3b44cf Mon Sep 17 00:00:00 2001 From: Tan Wang Leng Date: Sun, 28 Jan 2018 17:18:25 +0800 Subject: [PATCH 2/5] CommandBoxTest: Verify status stored in NewResultAvailableEvent CommandBox stores the success status of command execution in NewResultAvailableEvent. This behavior is not verified by any of the unit tests for CommandBox. Let's update the unit tests in CommandBoxTest to verify that behavior. --- .../java/seedu/address/ui/CommandBoxTest.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/test/java/seedu/address/ui/CommandBoxTest.java b/src/test/java/seedu/address/ui/CommandBoxTest.java index f72304570a7a..913f32ba7286 100644 --- a/src/test/java/seedu/address/ui/CommandBoxTest.java +++ b/src/test/java/seedu/address/ui/CommandBoxTest.java @@ -1,25 +1,33 @@ package seedu.address.ui; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; import java.util.ArrayList; import org.junit.Before; +import org.junit.Rule; import org.junit.Test; import guitests.guihandles.CommandBoxHandle; import javafx.scene.input.KeyCode; +import seedu.address.commons.events.ui.NewResultAvailableEvent; import seedu.address.logic.Logic; import seedu.address.logic.LogicManager; import seedu.address.logic.commands.ListCommand; import seedu.address.model.Model; import seedu.address.model.ModelManager; +import seedu.address.ui.testutil.EventsCollectorRule; public class CommandBoxTest extends GuiUnitTest { private static final String COMMAND_THAT_SUCCEEDS = ListCommand.COMMAND_WORD; private static final String COMMAND_THAT_FAILS = "invalid command"; + @Rule + public final EventsCollectorRule eventsCollectorRule = new EventsCollectorRule(); + private ArrayList defaultStyleOfCommandBox; private ArrayList errorStyleOfCommandBox; @@ -127,22 +135,34 @@ public void handleKeyPress_startingWithDown() { /** * Runs a command that fails, then verifies that
+ * - {@code NewResultAvailableEvent} is posted * - the text remains
* - the command box's style is the same as {@code errorStyleOfCommandBox}. */ private void assertBehaviorForFailedCommand() { commandBoxHandle.run(COMMAND_THAT_FAILS); + + assertFalse(((NewResultAvailableEvent) eventsCollectorRule.eventsCollector.getMostRecent()).isSuccessful); + assertTrue(eventsCollectorRule.eventsCollector.getSize() == 1); + eventsCollectorRule.eventsCollector.reset(); + assertEquals(COMMAND_THAT_FAILS, commandBoxHandle.getInput()); assertEquals(errorStyleOfCommandBox, commandBoxHandle.getStyleClass()); } /** * Runs a command that succeeds, then verifies that
+ * - {@code NewResultAvailableEvent} is posted * - the text is cleared
* - the command box's style is the same as {@code defaultStyleOfCommandBox}. */ private void assertBehaviorForSuccessfulCommand() { commandBoxHandle.run(COMMAND_THAT_SUCCEEDS); + + assertTrue(((NewResultAvailableEvent) eventsCollectorRule.eventsCollector.getMostRecent()).isSuccessful); + assertTrue(eventsCollectorRule.eventsCollector.getSize() == 1); + eventsCollectorRule.eventsCollector.reset(); + assertEquals("", commandBoxHandle.getInput()); assertEquals(defaultStyleOfCommandBox, commandBoxHandle.getStyleClass()); } From 3c79d313689eb06c243fefb6cff1d8d0ae534eed Mon Sep 17 00:00:00 2001 From: Tan Wang Leng Date: Sun, 28 Jan 2018 17:21:00 +0800 Subject: [PATCH 3/5] ResultDisplay: Display message in red when command fails The ResultDisplay shows the same color (white) regardless of whether the command executed by the user succeeded or failed. Changing the color of the message when the command execution failed gives a clear visual signal to the user that he made a mistake, and that the message shown is an error, rather than a normal message. Let's modify ResultDisplay to display the message in red when the command execution fails. --- .../java/seedu/address/ui/ResultDisplay.java | 33 ++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/src/main/java/seedu/address/ui/ResultDisplay.java b/src/main/java/seedu/address/ui/ResultDisplay.java index d05536bbee96..9ebe1037d934 100644 --- a/src/main/java/seedu/address/ui/ResultDisplay.java +++ b/src/main/java/seedu/address/ui/ResultDisplay.java @@ -7,6 +7,7 @@ import javafx.application.Platform; import javafx.beans.property.SimpleStringProperty; import javafx.beans.property.StringProperty; +import javafx.collections.ObservableList; import javafx.fxml.FXML; import javafx.scene.control.TextArea; import javafx.scene.layout.Region; @@ -18,6 +19,8 @@ */ public class ResultDisplay extends UiPart { + public static final String ERROR_STYLE_CLASS = "error"; + private static final Logger logger = LogsCenter.getLogger(ResultDisplay.class); private static final String FXML = "ResultDisplay.fxml"; @@ -35,7 +38,35 @@ public ResultDisplay() { @Subscribe private void handleNewResultAvailableEvent(NewResultAvailableEvent event) { logger.info(LogsCenter.getEventHandlingLogMessage(event)); - Platform.runLater(() -> displayed.setValue(event.message)); + Platform.runLater(() -> { + displayed.setValue(event.message); + + if (event.isSuccessful) { + setStyleToIndicateCommandSuccess(); + } else { + setStyleToIndicateCommandFailure(); + } + }); + } + + /** + * Sets the {@code ResultDisplay} style to use the default style. + */ + private void setStyleToIndicateCommandSuccess() { + resultDisplay.getStyleClass().remove(ERROR_STYLE_CLASS); + } + + /** + * Sets the {@code ResultDisplay} style to indicate a failed command. + */ + private void setStyleToIndicateCommandFailure() { + ObservableList styleClass = resultDisplay.getStyleClass(); + + if (styleClass.contains(ERROR_STYLE_CLASS)) { + return; + } + + styleClass.add(ERROR_STYLE_CLASS); } } From ca028a4d87b1be5381ce535ec3903958cd9ef69b Mon Sep 17 00:00:00 2001 From: Tan Wang Leng Date: Sun, 28 Jan 2018 17:22:42 +0800 Subject: [PATCH 4/5] ResultDisplayTest: Verify display turns red on error ResultDisplay will turn red when command execution fails. This behavior is not verified by any of the unit tests for ResultDisplay. Let's update the unit tests in ResultDisplayTest to verify that behavior. --- .../guihandles/ResultDisplayHandle.java | 9 +++++ .../seedu/address/ui/ResultDisplayTest.java | 40 ++++++++++++++++--- 2 files changed, 44 insertions(+), 5 deletions(-) diff --git a/src/test/java/guitests/guihandles/ResultDisplayHandle.java b/src/test/java/guitests/guihandles/ResultDisplayHandle.java index ec445e4154ff..0c8bcabe84ea 100644 --- a/src/test/java/guitests/guihandles/ResultDisplayHandle.java +++ b/src/test/java/guitests/guihandles/ResultDisplayHandle.java @@ -1,5 +1,7 @@ package guitests.guihandles; +import java.util.List; + import javafx.scene.control.TextArea; /** @@ -19,4 +21,11 @@ public ResultDisplayHandle(TextArea resultDisplayNode) { public String getText() { return getRootNode().getText(); } + + /** + * Returns the list of style classes present in the result display. + */ + public List getStyleClass() { + return getRootNode().getStyleClass(); + } } diff --git a/src/test/java/seedu/address/ui/ResultDisplayTest.java b/src/test/java/seedu/address/ui/ResultDisplayTest.java index e1825840c0e2..6c701ec9004a 100644 --- a/src/test/java/seedu/address/ui/ResultDisplayTest.java +++ b/src/test/java/seedu/address/ui/ResultDisplayTest.java @@ -3,6 +3,9 @@ import static org.junit.Assert.assertEquals; import static seedu.address.testutil.EventsUtil.postNow; +import java.util.ArrayList; +import java.util.List; + import org.junit.Before; import org.junit.Test; @@ -11,8 +14,14 @@ public class ResultDisplayTest extends GuiUnitTest { - private static final NewResultAvailableEvent NEW_RESULT_EVENT_STUB = - new NewResultAvailableEvent("Stub", true); + private static final NewResultAvailableEvent NEW_RESULT_SUCCESS_EVENT_STUB = + new NewResultAvailableEvent("success", true); + + private static final NewResultAvailableEvent NEW_RESULT_FAILURE_EVENT_STUB = + new NewResultAvailableEvent("failure", false); + + private List defaultStyleOfResultDisplay; + private List errorStyleOfResultDisplay; private ResultDisplayHandle resultDisplayHandle; @@ -23,6 +32,11 @@ public void setUp() { resultDisplayHandle = new ResultDisplayHandle(getChildNode(resultDisplay.getRoot(), ResultDisplayHandle.RESULT_DISPLAY_ID)); + + defaultStyleOfResultDisplay = new ArrayList<>(resultDisplayHandle.getStyleClass()); + + errorStyleOfResultDisplay = new ArrayList<>(defaultStyleOfResultDisplay); + errorStyleOfResultDisplay.add(ResultDisplay.ERROR_STYLE_CLASS); } @Test @@ -30,10 +44,26 @@ public void display() { // default result text guiRobot.pauseForHuman(); assertEquals("", resultDisplayHandle.getText()); + assertEquals(defaultStyleOfResultDisplay, resultDisplayHandle.getStyleClass()); - // new result received - postNow(NEW_RESULT_EVENT_STUB); + // receiving new results + assertResultDisplay(NEW_RESULT_SUCCESS_EVENT_STUB); + assertResultDisplay(NEW_RESULT_FAILURE_EVENT_STUB); + } + + /** + * Posts the {@code event} to the {@code EventsCenter}, then verifies that
+ * - the text on the result display matches the {@code event}'s message
+ * - the result display's style is the same as {@code defaultStyleOfResultDisplay} if event is successful, + * {@code errorStyleOfResultDisplay} otherwise. + */ + private void assertResultDisplay(NewResultAvailableEvent event) { + postNow(event); guiRobot.pauseForHuman(); - assertEquals(NEW_RESULT_EVENT_STUB.message, resultDisplayHandle.getText()); + + List expectedStyleClass = event.isSuccessful ? defaultStyleOfResultDisplay : errorStyleOfResultDisplay; + + assertEquals(event.message, resultDisplayHandle.getText()); + assertEquals(expectedStyleClass, resultDisplayHandle.getStyleClass()); } } From fc363ad447bc2afb556e3e1241191ba4e040a476 Mon Sep 17 00:00:00 2001 From: Tan Wang Leng Date: Sun, 7 Jan 2018 18:04:45 +0800 Subject: [PATCH 5/5] AddressBookSystemTest: Verify that ResultDisplay style changes The ResultDisplay style changes if there is an error in command execution. This behavior is not verified by any system tests. Let's update the system tests to verify that. --- .../systemtests/AddCommandSystemTest.java | 4 ++-- .../systemtests/AddressBookSystemTest.java | 19 +++++++++++++++---- .../systemtests/ClearCommandSystemTest.java | 4 ++-- .../systemtests/DeleteCommandSystemTest.java | 4 ++-- .../systemtests/EditCommandSystemTest.java | 4 ++-- .../systemtests/FindCommandSystemTest.java | 4 ++-- .../systemtests/HelpCommandSystemTest.java | 2 +- .../systemtests/SelectCommandSystemTest.java | 4 ++-- 8 files changed, 28 insertions(+), 17 deletions(-) diff --git a/src/test/java/systemtests/AddCommandSystemTest.java b/src/test/java/systemtests/AddCommandSystemTest.java index 4dee13251f3f..56958359d33f 100644 --- a/src/test/java/systemtests/AddCommandSystemTest.java +++ b/src/test/java/systemtests/AddCommandSystemTest.java @@ -229,7 +229,7 @@ private void assertCommandSuccess(String command, Model expectedModel, String ex executeCommand(command); assertApplicationDisplaysExpected("", expectedResultMessage, expectedModel); assertSelectedCardUnchanged(); - assertCommandBoxShowsDefaultStyle(); + assertCommandBoxAndResultDisplayShowsDefaultStyle(); assertStatusBarUnchangedExceptSyncStatus(); } @@ -250,7 +250,7 @@ private void assertCommandFailure(String command, String expectedResultMessage) executeCommand(command); assertApplicationDisplaysExpected(command, expectedResultMessage, expectedModel); assertSelectedCardUnchanged(); - assertCommandBoxShowsErrorStyle(); + assertCommandBoxAndResultDisplayShowsErrorStyle(); assertStatusBarUnchanged(); } } diff --git a/src/test/java/systemtests/AddressBookSystemTest.java b/src/test/java/systemtests/AddressBookSystemTest.java index 986c82360359..457b4cf064a4 100644 --- a/src/test/java/systemtests/AddressBookSystemTest.java +++ b/src/test/java/systemtests/AddressBookSystemTest.java @@ -43,6 +43,7 @@ import seedu.address.testutil.TypicalPersons; import seedu.address.ui.BrowserPanel; import seedu.address.ui.CommandBox; +import seedu.address.ui.ResultDisplay; /** * A system test class for AddressBook, which provides access to handles of GUI components and helper methods @@ -56,6 +57,9 @@ public abstract class AddressBookSystemTest { private static final List COMMAND_BOX_ERROR_STYLE = Arrays.asList("text-input", "text-field", CommandBox.ERROR_STYLE_CLASS); + private List defaultStyleOfResultDisplay; + private List errorStyleOfResultDisplay; + private MainWindowHandle mainWindowHandle; private TestApp testApp; private SystemTestSetupHelper setupHelper; @@ -71,6 +75,11 @@ public void setUp() { testApp = setupHelper.setupApplication(this::getInitialData, getDataFileLocation()); mainWindowHandle = setupHelper.setupMainWindowHandle(); + defaultStyleOfResultDisplay = mainWindowHandle.getResultDisplay().getStyleClass(); + + errorStyleOfResultDisplay = mainWindowHandle.getResultDisplay().getStyleClass(); + errorStyleOfResultDisplay.add(ResultDisplay.ERROR_STYLE_CLASS); + waitUntilBrowserLoaded(getBrowserPanel()); assertApplicationStartingStateIsCorrect(); } @@ -236,17 +245,19 @@ protected void assertSelectedCardUnchanged() { } /** - * Asserts that the command box's shows the default style. + * Asserts that the command box and result display shows the default style. */ - protected void assertCommandBoxShowsDefaultStyle() { + protected void assertCommandBoxAndResultDisplayShowsDefaultStyle() { assertEquals(COMMAND_BOX_DEFAULT_STYLE, getCommandBox().getStyleClass()); + assertEquals(defaultStyleOfResultDisplay, getResultDisplay().getStyleClass()); } /** - * Asserts that the command box's shows the error style. + * Asserts that the command box and result display shows the error style. */ - protected void assertCommandBoxShowsErrorStyle() { + protected void assertCommandBoxAndResultDisplayShowsErrorStyle() { assertEquals(COMMAND_BOX_ERROR_STYLE, getCommandBox().getStyleClass()); + assertEquals(errorStyleOfResultDisplay, getResultDisplay().getStyleClass()); } /** diff --git a/src/test/java/systemtests/ClearCommandSystemTest.java b/src/test/java/systemtests/ClearCommandSystemTest.java index 805a59784e29..d90c73736bba 100644 --- a/src/test/java/systemtests/ClearCommandSystemTest.java +++ b/src/test/java/systemtests/ClearCommandSystemTest.java @@ -76,7 +76,7 @@ private void assertCommandSuccess(String command) { private void assertCommandSuccess(String command, String expectedResultMessage, Model expectedModel) { executeCommand(command); assertApplicationDisplaysExpected("", expectedResultMessage, expectedModel); - assertCommandBoxShowsDefaultStyle(); + assertCommandBoxAndResultDisplayShowsDefaultStyle(); assertStatusBarUnchangedExceptSyncStatus(); } @@ -95,7 +95,7 @@ private void assertCommandFailure(String command, String expectedResultMessage) executeCommand(command); assertApplicationDisplaysExpected(command, expectedResultMessage, expectedModel); assertSelectedCardUnchanged(); - assertCommandBoxShowsErrorStyle(); + assertCommandBoxAndResultDisplayShowsErrorStyle(); assertStatusBarUnchanged(); } } diff --git a/src/test/java/systemtests/DeleteCommandSystemTest.java b/src/test/java/systemtests/DeleteCommandSystemTest.java index 97d42add1209..8eea181dc193 100644 --- a/src/test/java/systemtests/DeleteCommandSystemTest.java +++ b/src/test/java/systemtests/DeleteCommandSystemTest.java @@ -172,7 +172,7 @@ private void assertCommandSuccess(String command, Model expectedModel, String ex assertSelectedCardUnchanged(); } - assertCommandBoxShowsDefaultStyle(); + assertCommandBoxAndResultDisplayShowsDefaultStyle(); assertStatusBarUnchangedExceptSyncStatus(); } @@ -192,7 +192,7 @@ private void assertCommandFailure(String command, String expectedResultMessage) executeCommand(command); assertApplicationDisplaysExpected(command, expectedResultMessage, expectedModel); assertSelectedCardUnchanged(); - assertCommandBoxShowsErrorStyle(); + assertCommandBoxAndResultDisplayShowsErrorStyle(); assertStatusBarUnchanged(); } } diff --git a/src/test/java/systemtests/EditCommandSystemTest.java b/src/test/java/systemtests/EditCommandSystemTest.java index 38d82c61aaf0..73b273b9ee8d 100644 --- a/src/test/java/systemtests/EditCommandSystemTest.java +++ b/src/test/java/systemtests/EditCommandSystemTest.java @@ -276,7 +276,7 @@ private void assertCommandSuccess(String command, Model expectedModel, String ex executeCommand(command); expectedModel.updateFilteredPersonList(PREDICATE_SHOW_ALL_PERSONS); assertApplicationDisplaysExpected("", expectedResultMessage, expectedModel); - assertCommandBoxShowsDefaultStyle(); + assertCommandBoxAndResultDisplayShowsDefaultStyle(); if (expectedSelectedCardIndex != null) { assertSelectedCardChanged(expectedSelectedCardIndex); } else { @@ -301,7 +301,7 @@ private void assertCommandFailure(String command, String expectedResultMessage) executeCommand(command); assertApplicationDisplaysExpected(command, expectedResultMessage, expectedModel); assertSelectedCardUnchanged(); - assertCommandBoxShowsErrorStyle(); + assertCommandBoxAndResultDisplayShowsErrorStyle(); assertStatusBarUnchanged(); } } diff --git a/src/test/java/systemtests/FindCommandSystemTest.java b/src/test/java/systemtests/FindCommandSystemTest.java index 0bde83c0444b..12b69232afb6 100644 --- a/src/test/java/systemtests/FindCommandSystemTest.java +++ b/src/test/java/systemtests/FindCommandSystemTest.java @@ -170,7 +170,7 @@ private void assertCommandSuccess(String command, Model expectedModel) { executeCommand(command); assertApplicationDisplaysExpected("", expectedResultMessage, expectedModel); - assertCommandBoxShowsDefaultStyle(); + assertCommandBoxAndResultDisplayShowsDefaultStyle(); assertStatusBarUnchanged(); } @@ -189,7 +189,7 @@ private void assertCommandFailure(String command, String expectedResultMessage) executeCommand(command); assertApplicationDisplaysExpected(command, expectedResultMessage, expectedModel); assertSelectedCardUnchanged(); - assertCommandBoxShowsErrorStyle(); + assertCommandBoxAndResultDisplayShowsErrorStyle(); assertStatusBarUnchanged(); } } diff --git a/src/test/java/systemtests/HelpCommandSystemTest.java b/src/test/java/systemtests/HelpCommandSystemTest.java index 3fa0cc98236e..cb249e39c1c0 100644 --- a/src/test/java/systemtests/HelpCommandSystemTest.java +++ b/src/test/java/systemtests/HelpCommandSystemTest.java @@ -62,7 +62,7 @@ public void openHelpWindow() { // assert that while the help window is open the UI updates correctly for a command execution executeCommand(SelectCommand.COMMAND_WORD + " " + INDEX_FIRST_PERSON.getOneBased()); assertEquals("", getCommandBox().getInput()); - assertCommandBoxShowsDefaultStyle(); + assertCommandBoxAndResultDisplayShowsDefaultStyle(); assertNotEquals(HelpCommand.SHOWING_HELP_MESSAGE, getResultDisplay().getText()); assertNotEquals(BrowserPanel.DEFAULT_PAGE, getBrowserPanel().getLoadedUrl()); assertListMatching(getPersonListPanel(), getModel().getFilteredPersonList()); diff --git a/src/test/java/systemtests/SelectCommandSystemTest.java b/src/test/java/systemtests/SelectCommandSystemTest.java index aaacea0120f2..5f44b5399ce2 100644 --- a/src/test/java/systemtests/SelectCommandSystemTest.java +++ b/src/test/java/systemtests/SelectCommandSystemTest.java @@ -126,7 +126,7 @@ private void assertCommandSuccess(String command, Index expectedSelectedCardInde assertSelectedCardChanged(expectedSelectedCardIndex); } - assertCommandBoxShowsDefaultStyle(); + assertCommandBoxAndResultDisplayShowsDefaultStyle(); assertStatusBarUnchanged(); } @@ -147,7 +147,7 @@ private void assertCommandFailure(String command, String expectedResultMessage) executeCommand(command); assertApplicationDisplaysExpected(command, expectedResultMessage, expectedModel); assertSelectedCardUnchanged(); - assertCommandBoxShowsErrorStyle(); + assertCommandBoxAndResultDisplayShowsErrorStyle(); assertStatusBarUnchanged(); } }