@@ -0,0 +1,3232 @@
+package seedu.address.ui;%0A%0Aimport java.util.NoSuchElementException;%0Aimport java.util.concurrent.TimeUnit;%0A%0Aimport org.junit.After;%0Aimport org.junit.Before;%0Aimport org.junit.BeforeClass;%0Aimport org.junit.Test;%0Aimport org.junit.experimental.categories.Category;%0Aimport org.mockito.Mock;%0Aimport org.mockito.Mockito;%0Aimport org.mockito.MockitoAnnotations;%0Aimport org.testfx.api.FxRobot;%0Aimport org.testfx.api.FxToolkit;%0Aimport org.testfx.util.WaitForAsyncUtils;%0A%0Aimport javafx.application.Platform;%0Aimport javafx.collections.FXCollections;%0Aimport javafx.collections.ObservableList;%0Aimport javafx.stage.Window;%0Aimport seedu.address.commons.core.Config;%0Aimport seedu.address.commons.core.EventsCenter;%0Aimport seedu.address.commons.events.ui.ShowHelpRequestEvent;%0Aimport seedu.address.logic.Logic;%0Aimport seedu.address.model.UserPrefs;%0Aimport seedu.address.model.task.DeadlineTask;%0Aimport seedu.address.model.task.EventTask;%0Aimport seedu.address.model.task.FloatingTask;%0Aimport seedu.address.testutil.GuiTests;%0A%0A@Category(%7BGuiTests.class%7D)%0Apublic class UiManagerTest extends FxRobot %7B%0A%0A    private Config config;%0A%0A    private UserPrefs userPrefs;%0A%0A    private ObservableList%3CFloatingTask%3E floatingTaskList;%0A%0A    private ObservableList%3CEventTask%3E eventTaskList;%0A%0A    private ObservableList%3CDeadlineTask%3E deadlineTaskList;%0A%0A    @Mock%0A    private Logic logic;%0A%0A    private UiManager uiManager;%0A%0A    @BeforeClass%0A    public static void setupFxToolkit() throws Exception %7B%0A        FxToolkit.registerPrimaryStage();%0A    %7D%0A%0A    @Before%0A    public void setup() throws Exception %7B%0A        MockitoAnnotations.initMocks(this);%0A        floatingTaskList = FXCollections.observableArrayList();%0A        eventTaskList = FXCollections.observableArrayList();%0A        deadlineTaskList = FXCollections.observableArrayList();%0A        Mockito.when(logic.getFilteredFloatingTaskList())%0A               .thenReturn(FXCollections.unmodifiableObservableList(floatingTaskList));%0A        Mockito.when(logic.getFilteredDeadlineTaskList())%0A               .thenReturn(FXCollections.unmodifiableObservableList(deadlineTaskList));%0A        Mockito.when(logic.getFilteredEventTaskList())%0A               .thenReturn(FXCollections.unmodifiableObservableList(eventTaskList));%0A        userPrefs = new UserPrefs();%0A        config = new Config();%0A        uiManager = new UiManager(logic, config, userPrefs);%0A        FxToolkit.setupStage(stage -%3E %7B%0A            uiManager.start(stage);%0A        %7D);%0A        FxToolkit.showStage();%0A    %7D%0A%0A    @After%0A    public void teardown() throws Exception %7B%0A        interact(() -%3E uiManager.stop());%0A        FxToolkit.cleanupStages();%0A    %7D%0A%0A    @Test%0A    public void startStop_works() %7B%0A    %7D%0A%0A    @Test%0A    public void onShowHelpRequestEvent_showsHelp() throws Exception %7B%0A        Platform.runLater((() -%3E EventsCenter.getInstance().post(new ShowHelpRequestEvent())));%0A        WaitForAsyncUtils.waitFor(3, TimeUnit.SECONDS, () -%3E %7B%0A            try %7B%0A                Window w = window(window -%3E from(rootNode(window)).lookup(%22#webView%22).tryQuery().isPresent());%0A                interact(() -%3E w.hide());%0A                return true;%0A            %7D catch (NoSuchElementException e) %7B%0A                return false;%0A            %7D%0A        %7D);%0A    %7D%0A%0A%7D%0A

add UiManagerTest