use of com.ait.lienzo.client.widget.panel.impl.PreviewPanel in project kie-wb-common by kiegroup.
the class PreviewLienzoPanelTest method testInit.
@Test
@SuppressWarnings("unchecked")
public void testInit() {
tested.init();
ArgumentCaptor<BiFunction> builderCaptor = ArgumentCaptor.forClass(BiFunction.class);
verify(panel, times(1)).setPanelBuilder(builderCaptor.capture());
BiFunction<OptionalInt, OptionalInt, LienzoBoundsPanel> builder = builderCaptor.getValue();
LienzoBoundsPanel result = builder.apply(OptionalInt.of(300), OptionalInt.of(450));
assertTrue(result instanceof PreviewPanel);
assertEquals(300, result.getWidthPx());
assertEquals(450, result.getHeightPx());
}
use of com.ait.lienzo.client.widget.panel.impl.PreviewPanel in project kie-wb-common by kiegroup.
the class PreviewLienzoPanelTest method testRefresh.
@Test
public void testRefresh() {
PreviewPanel view = mock(PreviewPanel.class);
when(panel.getView()).thenReturn(view);
ScrollableLienzoPanel delegate = mock(ScrollableLienzoPanel.class);
StunnerLienzoBoundsPanel delegate2 = mock(StunnerLienzoBoundsPanel.class);
when(delegate.getDelegate()).thenReturn(delegate2);
ScrollablePanel previewView = mock(ScrollablePanel.class);
when(delegate2.getView()).thenReturn(previewView);
tested.observe(delegate);
verify(view, times(1)).observe(eq(previewView));
}
Aggregations