Search in sources :

Example 6 with PlaceGainFocusEvent

use of org.uberfire.client.workbench.events.PlaceGainFocusEvent in project kie-wb-common by kiegroup.

the class LibraryPlacesTest method onSelectProjectSettingsTest.

@Test
public void onSelectProjectSettingsTest() {
    doReturn(PlaceStatus.OPEN).when(placeManager).getStatus(LibraryPlaces.LIBRARY_PERSPECTIVE);
    final DefaultPlaceRequest projectSettingsPlaceRequest = new DefaultPlaceRequest(LibraryPlaces.PROJECT_SETTINGS);
    final PlaceGainFocusEvent placeGainFocusEvent = mock(PlaceGainFocusEvent.class);
    doReturn(projectSettingsPlaceRequest).when(placeGainFocusEvent).getPlace();
    libraryPlaces.onSelectPlaceEvent(placeGainFocusEvent);
    verify(libraryPlaces).hideDocks();
    verify(libraryPlaces).setupLibraryBreadCrumbsForAsset(null);
}
Also used : PlaceGainFocusEvent(org.uberfire.client.workbench.events.PlaceGainFocusEvent) DefaultPlaceRequest(org.uberfire.mvp.impl.DefaultPlaceRequest) Test(org.junit.Test)

Example 7 with PlaceGainFocusEvent

use of org.uberfire.client.workbench.events.PlaceGainFocusEvent in project kie-wb-common by kiegroup.

the class LibraryPlacesTest method onSelectPlaceOutsideLibraryTest.

@Test
public void onSelectPlaceOutsideLibraryTest() {
    doReturn(PlaceStatus.CLOSE).when(placeManager).getStatus(LibraryPlaces.LIBRARY_PERSPECTIVE);
    doReturn(PlaceStatus.CLOSE).when(placeManager).getStatus(any(PlaceRequest.class));
    final PlaceGainFocusEvent placeGainFocusEvent = mock(PlaceGainFocusEvent.class);
    libraryPlaces.onSelectPlaceEvent(placeGainFocusEvent);
    verify(placeGainFocusEvent, never()).getPlace();
}
Also used : PathPlaceRequest(org.uberfire.mvp.impl.PathPlaceRequest) DefaultPlaceRequest(org.uberfire.mvp.impl.DefaultPlaceRequest) PlaceRequest(org.uberfire.mvp.PlaceRequest) PlaceGainFocusEvent(org.uberfire.client.workbench.events.PlaceGainFocusEvent) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)7 PlaceGainFocusEvent (org.uberfire.client.workbench.events.PlaceGainFocusEvent)7 DefaultPlaceRequest (org.uberfire.mvp.impl.DefaultPlaceRequest)4 PathPlaceRequest (org.uberfire.mvp.impl.PathPlaceRequest)3 OnDiagramFocusEvent (org.kie.workbench.common.stunner.project.client.editor.event.OnDiagramFocusEvent)2 PlaceRequest (org.uberfire.mvp.PlaceRequest)2 ObservablePath (org.uberfire.backend.vfs.ObservablePath)1