Search in sources :

Example 1 with TableComponentDescriptor

use of de.diedavids.sneferu.components.descriptor.TableComponentDescriptor in project jmix-sneferu by mariodavid.

the class SelectInListInteractionTest method when_interactionIsPerformedWithMultiSelection_then_allValuesAreSet.

@Test
void when_interactionIsPerformedWithMultiSelection_then_allValuesAreSet(UiTestAPI uiTestAPI) {
    // given:
    final PetType ice = storePetType("Ice");
    final PetType water = storePetType("Water");
    final PetType dragon = storePetType("Dragon");
    // and:
    final StandardLookupTestAPI<PetType, PetTypeBrowse> openedScreen = uiTestAPI.openStandardLookup(PetType.class, PetTypeBrowse.class);
    final TableComponentDescriptor table = table("table");
    assertThat(openedScreen.rawComponent(table).isMultiSelect()).isTrue();
    // when:
    openedScreen.interact(selectInList(table, Lists.list(water, dragon)));
    // then:
    final Set<PetType> selectedPetTypesInTable = openedScreen.rawComponent(table).getSelected();
    // and:
    assertThat(selectedPetTypesInTable).contains(water, dragon);
}
Also used : TableComponentDescriptor(de.diedavids.sneferu.components.descriptor.TableComponentDescriptor) PetTypeBrowse(io.jmix.petclinic.screen.pet.pettype.PetTypeBrowse) PetType(io.jmix.petclinic.entity.pet.PetType) SneferuUiTest(de.diedavids.sneferu.SneferuUiTest) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Aggregations

SneferuUiTest (de.diedavids.sneferu.SneferuUiTest)1 TableComponentDescriptor (de.diedavids.sneferu.components.descriptor.TableComponentDescriptor)1 PetType (io.jmix.petclinic.entity.pet.PetType)1 PetTypeBrowse (io.jmix.petclinic.screen.pet.pettype.PetTypeBrowse)1 Test (org.junit.jupiter.api.Test)1 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)1