use of org.uberfire.ext.layout.editor.client.api.ModalConfigurationContext in project kie-wb-common by kiegroup.
the class EditorFieldLayoutComponentTest method testOnPressOk.
protected void testOnPressOk(boolean bound, boolean withConfigContext) {
FieldDefinition fieldCopy = setupFormEditorHelper();
ModalConfigurationContext ctx = mock(ModalConfigurationContext.class);
if (bound) {
when(fieldCopy.getBinding()).thenReturn(BINDING_FIRSTNAME);
}
if (withConfigContext) {
when(ctx.getComponentProperties()).thenReturn(mock(Map.class));
editorFieldLayoutComponent.getConfigurationModal(ctx);
}
editorFieldLayoutComponent.onPressOk(fieldCopy);
assertSame(fieldCopy, editorFieldLayoutComponent.getField());
verify(syncPaletteEvent).fire(any());
verify(formEditorHelper, bound ? times(1) : times(0)).removeAvailableField(any());
verify(ctx, withConfigContext ? times(1) : times(0)).configurationFinished();
}
use of org.uberfire.ext.layout.editor.client.api.ModalConfigurationContext in project kie-wb-common by kiegroup.
the class EditorFieldLayoutComponentTest method testHelperOnCloseWithContext.
@Test
public void testHelperOnCloseWithContext() {
ModalConfigurationContext ctx = mock(ModalConfigurationContext.class);
when(ctx.getComponentProperties()).thenReturn(mock(Map.class));
testDroppingNewField();
editorFieldLayoutComponent.getConfigurationModal(ctx);
propertiesRendererHelper.onClose();
assertFalse(editorFieldLayoutComponent.showProperties);
verify(ctx).configurationCancelled();
}
use of org.uberfire.ext.layout.editor.client.api.ModalConfigurationContext in project kie-wb-common by kiegroup.
the class EditorFieldLayoutComponentTest method testOpenFieldProperties.
@Test
public void testOpenFieldProperties() {
testDroppingNewField();
ModalConfigurationContext modalConfigurationContext = mock(ModalConfigurationContext.class);
when(modalConfigurationContext.getComponentProperties()).thenReturn(layoutComponent.getProperties());
editorFieldLayoutComponent.getConfigurationModal(modalConfigurationContext);
verify(propertiesRenderer).render(any());
verify(propertiesRenderer).getView();
verify(fieldPropertiesRendererView).getPropertiesModal();
}
use of org.uberfire.ext.layout.editor.client.api.ModalConfigurationContext in project kie-wb-common by kiegroup.
the class EditorFieldLayoutComponentTest method testOpenFieldPropertiesBeforeDrop.
@Test
public void testOpenFieldPropertiesBeforeDrop() {
ModalConfigurationContext modalConfigurationContext = mock(ModalConfigurationContext.class);
when(modalConfigurationContext.getComponentProperties()).thenReturn(layoutComponent.getProperties());
editorFieldLayoutComponent.getConfigurationModal(modalConfigurationContext);
verify(editorFieldLayoutComponent).init(context, fieldDefinition);
verify(fieldRenderer).init(context, fieldDefinition);
verify(propertiesRenderer).render(any());
}
Aggregations