use of org.kie.workbench.common.screens.archetype.mgmt.client.table.config.ArchetypeTableConfiguration in project kie-wb-common by kiegroup.
the class GlobalArchetypeTablePresenterTest method initConfigurationTest.
@Test
public void initConfigurationTest() {
final ArchetypeTableConfiguration expectedConfig = new ArchetypeTableConfiguration.Builder().withAddAction().withDeleteAction().withValidateAction().withStatusColumn().build();
assertEquals(expectedConfig, presenter.initConfiguration());
}
use of org.kie.workbench.common.screens.archetype.mgmt.client.table.config.ArchetypeTableConfiguration in project kie-wb-common by kiegroup.
the class AbstractArchetypeTablePresenterTest method isShowDeleteActionWhenIsTrueTest.
@Test
public void isShowDeleteActionWhenIsTrueTest() {
final ArchetypeTableConfiguration config = new ArchetypeTableConfiguration.Builder().withDeleteAction().build();
doReturn(config).when(presenter).getConfiguration();
final boolean result = presenter.isShowDeleteAction();
assertTrue(result);
}
use of org.kie.workbench.common.screens.archetype.mgmt.client.table.config.ArchetypeTableConfiguration in project kie-wb-common by kiegroup.
the class AbstractArchetypeTablePresenterTest method configureViewWhenSearchEmptyTest.
@Test
public void configureViewWhenSearchEmptyTest() {
setPresenterPrivateField("searchFilter", "keyword");
final ArchetypeTableConfiguration config = new ArchetypeTableConfiguration.Builder().withAddAction().withIncludeColumn().withStatusColumn().build();
doReturn(config).when(presenter).getConfiguration();
final PaginatedArchetypeList paginatedArchetypeList = new PaginatedArchetypeList(Collections.emptyList(), 0, 0, 0);
presenter.configureView(paginatedArchetypeList);
verify(view).showAddAction(true);
verify(view).showIncludeHeader(true);
verify(view).showStatusHeader(true);
verify(view).showSelectionCounter(true);
verify(view).showNoResults(true);
verify(view).showPagination(false);
verify(view).showToolbar(true);
verify(view).showEmpty(false);
}
use of org.kie.workbench.common.screens.archetype.mgmt.client.table.config.ArchetypeTableConfiguration in project kie-wb-common by kiegroup.
the class AbstractArchetypeTablePresenterTest method isShowStatusColumnWhenIsFalseTest.
@Test
public void isShowStatusColumnWhenIsFalseTest() {
final ArchetypeTableConfiguration config = new ArchetypeTableConfiguration.Builder().build();
doReturn(config).when(presenter).getConfiguration();
final boolean result = presenter.isShowStatusColumn();
assertFalse(result);
}
use of org.kie.workbench.common.screens.archetype.mgmt.client.table.config.ArchetypeTableConfiguration in project kie-wb-common by kiegroup.
the class AbstractArchetypeTablePresenterTest method configureViewWhenPopulatedTest.
@Test
public void configureViewWhenPopulatedTest() {
final ArchetypeTableConfiguration config = new ArchetypeTableConfiguration.Builder().withAddAction().withIncludeColumn().withStatusColumn().build();
doReturn(config).when(presenter).getConfiguration();
final PaginatedArchetypeList paginatedArchetypeList = new PaginatedArchetypeList(Collections.nCopies(10, mock(Archetype.class)), 0, 10, 10);
presenter.configureView(paginatedArchetypeList);
verify(view).showAddAction(true);
verify(view).showIncludeHeader(true);
verify(view).showStatusHeader(true);
verify(view).showSelectionCounter(true);
verify(view).showNoResults(false);
verify(view).showPagination(true);
verify(view).showToolbar(true);
verify(view).showEmpty(false);
}
Aggregations