use of org.kie.workbench.common.widgets.metadata.client.KieDocument in project kie-wb-common by kiegroup.
the class RegisteredDocumentsMenuBuilderTest method checkNotReadOnlyDisplaysCloseIcon.
@Test
public void checkNotReadOnlyDisplaysCloseIcon() {
final KieDocument document = makeKieDocument();
builder.registerDocument(document);
// By default DocumentMenuItems are set to be read-only
verify(documentMenuItem, times(1)).setReadOnly(eq(false));
builder.setReadOnly(false);
verify(view, times(1)).setReadOnly(eq(false));
verify(documentMenuItem, times(2)).setReadOnly(eq(false));
}
use of org.kie.workbench.common.widgets.metadata.client.KieDocument in project kie-wb-common by kiegroup.
the class RegisteredDocumentsMenuBuilderTest method testOnActivateDocument_WithCommand.
@Test
@SuppressWarnings("unchecked")
public void testOnActivateDocument_WithCommand() {
final KieDocument document = makeKieDocument();
final ParameterizedCommand command = mock(ParameterizedCommand.class);
builder.setActivateDocumentCommand(command);
builder.onActivateDocument(document);
verify(command, times(1)).execute(eq(document));
}
use of org.kie.workbench.common.widgets.metadata.client.KieDocument in project kie-wb-common by kiegroup.
the class RegisteredDocumentsMenuBuilderTest method testDispose.
@Test
public void testDispose() {
final KieDocument document = makeKieDocument();
builder.registerDocument(document);
builder.dispose();
verify(view, times(1)).clear();
}
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 kie-wb-common by kiegroup.
the class RegisteredDocumentsMenuBuilderTest method testOnRemoveDocument_WithCommand.
@Test
@SuppressWarnings("unchecked")
public void testOnRemoveDocument_WithCommand() {
final KieDocument document = makeKieDocument();
final ParameterizedCommand command = mock(ParameterizedCommand.class);
builder.setRemoveDocumentCommand(command);
builder.onRemoveDocument(document);
verify(command, times(1)).execute(eq(document));
}
Aggregations