use of org.kie.workbench.common.widgets.metadata.client.KieDocument in project kie-wb-common by kiegroup.
the class RegisteredDocumentsMenuBuilderTest method checkReadOnlyHidesCloseIcon.
@Test
public void checkReadOnlyHidesCloseIcon() {
final KieDocument document = makeKieDocument();
builder.registerDocument(document);
builder.setReadOnly(true);
verify(view, times(1)).setReadOnly(eq(true));
verify(documentMenuItem, times(1)).setReadOnly(eq(true));
}
use of org.kie.workbench.common.widgets.metadata.client.KieDocument in project drools-wb by kiegroup.
the class GuidedDecisionTableGraphEditorPresenterTest method checkInitRemoveDocumentFromRegisteredDocumentMenu.
@Test
public void checkInitRemoveDocumentFromRegisteredDocumentMenu() {
verify(registeredDocumentsMenuBuilder, times(1)).setRemoveDocumentCommand(removeDocumentCommandCaptor.capture());
final GuidedDecisionTablePresenter dtPresenter = mock(GuidedDecisionTablePresenter.class);
doReturn(true).when(presenter).mayClose(eq(dtPresenter));
doNothing().when(presenter).removeDocument(any(GuidedDecisionTablePresenter.class));
final ParameterizedCommand<KieDocument> removeDocumentCommand = removeDocumentCommandCaptor.getValue();
assertNotNull(removeDocumentCommand);
removeDocumentCommand.execute(dtPresenter);
verify(presenter, times(1)).mayClose(eq(dtPresenter));
verify(presenter, times(1)).removeDocument(eq(dtPresenter));
}
use of org.kie.workbench.common.widgets.metadata.client.KieDocument in project drools-wb by kiegroup.
the class GuidedDecisionTableGraphEditorPresenterTest method checkInitActivateDocumentFromRegisteredDocumentMenu.
@Test
public void checkInitActivateDocumentFromRegisteredDocumentMenu() {
verify(registeredDocumentsMenuBuilder, times(1)).setActivateDocumentCommand(activateDocumentCommandCaptor.capture());
final GuidedDecisionTablePresenter dtPresenter = mock(GuidedDecisionTablePresenter.class);
final ParameterizedCommand<KieDocument> activeDocumentCommand = activateDocumentCommandCaptor.getValue();
assertNotNull(activeDocumentCommand);
activeDocumentCommand.execute(dtPresenter);
verify(decisionTableSelectedEvent, times(1)).fire(dtSelectedEventCaptor.capture());
assertNotNull(dtSelectedEventCaptor.getValue());
assertEquals(dtPresenter, dtSelectedEventCaptor.getValue().getPresenter().get());
}
Aggregations