use of io.jmix.petclinic.screen.veterinarian.veterinarian.VeterinarianEdit in project jmix-sneferu by mariodavid.
the class CloseEditorInteractionTest method given_invalidForm_when_interactionIsPerformedWith_then_screenIsClosedAndFailIsReturned.
@Test
void given_invalidForm_when_interactionIsPerformedWith_then_screenIsClosedAndFailIsReturned(UiTestAPI uiTestAPI) {
// given:
StandardEditorTestAPI<Veterinarian, VeterinarianEdit> visitEdit = uiTestAPI.openStandardEditor(Veterinarian.class, VeterinarianEdit.class);
// and:
visitEdit.interact(enter(textInputField("firstNameField"), null));
// when:
final OperationResult operationResult = visitEdit.andThenGet(closeEditor());
// then:
assertThat(operationResult).isEqualTo(OperationResult.fail());
}
use of io.jmix.petclinic.screen.veterinarian.veterinarian.VeterinarianEdit in project jmix-sneferu by mariodavid.
the class CancelEditorInteractionTest method when_interactionIsPerformed_then_screenIsCanceledAndNothingIsCommitted.
@Test
void when_interactionIsPerformed_then_screenIsCanceledAndNothingIsCommitted(UiTestAPI uiTestAPI) {
// given:
StandardEditorTestAPI<Veterinarian, VeterinarianEdit> visitEdit = uiTestAPI.openStandardEditor(Veterinarian.class, VeterinarianEdit.class);
// and:
visitEdit.interact(enter(textInputField("firstNameField"), "Oak"));
// when:
final OperationResult operationResult = visitEdit.andThenGet(cancelEditor());
// then:
assertThat(operationResult).isEqualTo(OperationResult.success());
// and:
assertThat(dataManager.load(Veterinarian.class).all().list()).isEmpty();
}
use of io.jmix.petclinic.screen.veterinarian.veterinarian.VeterinarianEdit in project jmix-sneferu by mariodavid.
the class CloseEditorInteractionTest method given_validForm_when_interactionIsPerformed_then_screenIsClosedAndSuccessIsReturned.
@Test
void given_validForm_when_interactionIsPerformed_then_screenIsClosedAndSuccessIsReturned(UiTestAPI uiTestAPI) {
// given:
StandardEditorTestAPI<Veterinarian, VeterinarianEdit> visitEdit = uiTestAPI.openStandardEditor(Veterinarian.class, VeterinarianEdit.class);
// and:
visitEdit.interact(enter(textInputField("firstNameField"), "Oak"));
// when:
final OperationResult operationResult = visitEdit.andThenGet(closeEditor());
// then:
assertThat(operationResult).isEqualTo(OperationResult.success());
}
Aggregations