Search in sources :

Example 16 with DNDListComponent

use of org.kie.workbench.common.dmn.client.editors.types.listview.draganddrop.DNDListComponent in project kie-wb-common by kiegroup.

the class DataTypeSearchBarTest method testRestoreDataTypeListPositionsWhenSearchBarDoesNotHaveDataTypeListPositionsStored.

@Test
public void testRestoreDataTypeListPositionsWhenSearchBarDoesNotHaveDataTypeListPositionsStored() {
    final DNDListComponent dndListComponent = mock(DNDListComponent.class);
    final Map<String, Integer> store = spy(new HashMap<>());
    final Map<String, Boolean> collapsedStore = spy(new HashMap<>());
    when(dataTypeList.getDNDListComponent()).thenReturn(dndListComponent);
    doReturn(store).when(searchBar).getDataTypeListPositionsStore();
    doReturn(collapsedStore).when(searchBar).getDataTypeListCollapsedStatusStore();
    searchBar.restoreDataTypeListPositions();
    verify(dndListComponent, never()).setPositionY(any(), anyDouble());
    verify(dndListComponent, never()).refreshItemsPosition();
    verify(store, never()).clear();
    verify(collapsedStore, never()).clear();
}
Also used : DNDListComponent(org.kie.workbench.common.dmn.client.editors.types.listview.draganddrop.DNDListComponent) Test(org.junit.Test)

Aggregations

DNDListComponent (org.kie.workbench.common.dmn.client.editors.types.listview.draganddrop.DNDListComponent)16 Test (org.junit.Test)15 HTMLElement (elemental2.dom.HTMLElement)10 DataType (org.kie.workbench.common.dmn.client.editors.types.common.DataType)7 DataTypeListItem (org.kie.workbench.common.dmn.client.editors.types.listview.DataTypeListItem)4 Element (elemental2.dom.Element)3 DOMTokenList (elemental2.dom.DOMTokenList)2 HashMap (java.util.HashMap)2 DataTypeConstraint (org.kie.workbench.common.dmn.client.editors.types.listview.constraint.DataTypeConstraint)2