use of io.jmix.petclinic.entity.pet.PetType in project jmix-sneferu by mariodavid.
the class SelectInListInteractionTest method storePetType.
private PetType storePetType(String name) {
PetType entity = dataManager.create(PetType.class);
entity.setName(name);
return dataManager.save(entity);
}
use of io.jmix.petclinic.entity.pet.PetType in project jmix-sneferu by mariodavid.
the class PetBrowseTest method storePetType.
@NotNull
private PetType storePetType(String name) {
final PetType petType = dataManager.create(PetType.class);
petType.setName(name);
return dataManager.save(petType);
}
use of io.jmix.petclinic.entity.pet.PetType 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);
}
use of io.jmix.petclinic.entity.pet.PetType in project jmix-sneferu by mariodavid.
the class PetBrowseTest method interactWithPetBrowse_throughPetBrowseScreenObject.
@Test
void interactWithPetBrowse_throughPetBrowseScreenObject(UiTestAPI uiTestAPI) {
// given:
final PetType water = storePetType("Water");
final PetType dragon = storePetType("Dragon");
final Pet waterPet1 = storePetForType(water);
final Pet waterPet2 = storePetForType(water);
final Pet dragonPet1 = storePetForType(dragon);
final Pet dragonPet2 = storePetForType(dragon);
// and:
final PetBrowseScreen petBrowse = PetBrowseScreen.open(uiTestAPI);
assertThat(petBrowse.isActive()).isTrue();
// and:
assertThat(petBrowse.petCount()).isEqualTo(4);
// when:
petBrowse.filterByType(dragon);
// then:
assertThat(petBrowse.petCount()).isEqualTo(2);
// and:
assertThat(petBrowse.pets()).contains(dragonPet1, dragonPet2).doesNotContain(waterPet1, waterPet2);
}
Aggregations