Search in sources :

Example 6 with ArchetypeTableConfiguration

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());
}
Also used : ArchetypeTableConfiguration(org.kie.workbench.common.screens.archetype.mgmt.client.table.config.ArchetypeTableConfiguration) Test(org.junit.Test)

Example 7 with ArchetypeTableConfiguration

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);
}
Also used : ArchetypeTableConfiguration(org.kie.workbench.common.screens.archetype.mgmt.client.table.config.ArchetypeTableConfiguration) Test(org.junit.Test)

Example 8 with ArchetypeTableConfiguration

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);
}
Also used : PaginatedArchetypeList(org.kie.workbench.common.screens.archetype.mgmt.shared.model.PaginatedArchetypeList) ArchetypeTableConfiguration(org.kie.workbench.common.screens.archetype.mgmt.client.table.config.ArchetypeTableConfiguration) Test(org.junit.Test)

Example 9 with ArchetypeTableConfiguration

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);
}
Also used : ArchetypeTableConfiguration(org.kie.workbench.common.screens.archetype.mgmt.client.table.config.ArchetypeTableConfiguration) Test(org.junit.Test)

Example 10 with ArchetypeTableConfiguration

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);
}
Also used : PaginatedArchetypeList(org.kie.workbench.common.screens.archetype.mgmt.shared.model.PaginatedArchetypeList) ArchetypeTableConfiguration(org.kie.workbench.common.screens.archetype.mgmt.client.table.config.ArchetypeTableConfiguration) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)13 ArchetypeTableConfiguration (org.kie.workbench.common.screens.archetype.mgmt.client.table.config.ArchetypeTableConfiguration)13 PaginatedArchetypeList (org.kie.workbench.common.screens.archetype.mgmt.shared.model.PaginatedArchetypeList)3