Search in sources :

Example 6 with SerialNumber

use of org.activityinfo.model.type.SerialNumber in project activityinfo by bedatadriven.

the class FormInputViewModelTest method testSerialNumberEdit.

@Test
public void testSerialNumberEdit() {
    IntakeForm intakeForm = setup.getCatalog().getIntakeForm();
    RecordRef ref = intakeForm.getRecords().get(0).getRef();
    FormStructure structure = fetchStructure(ref);
    FormInputViewModelBuilder builder = builderFor(structure);
    FormInputModel model = new FormInputModel(ref);
    FormInputViewModel viewModel = builder.build(model, structure.getExistingRecord());
    assertThat(viewModel.getField(intakeForm.getProtectionCodeFieldId()), equalTo(new SerialNumber(1)));
}
Also used : SerialNumber(org.activityinfo.model.type.SerialNumber) RecordRef(org.activityinfo.model.type.RecordRef) FormInputModel(org.activityinfo.ui.client.input.model.FormInputModel) Test(org.junit.Test)

Aggregations

SerialNumber (org.activityinfo.model.type.SerialNumber)6 SerialNumberType (org.activityinfo.model.type.SerialNumberType)5 Test (org.junit.Test)5 FormClass (org.activityinfo.model.form.FormClass)4 FormField (org.activityinfo.model.form.FormField)4 FormInstance (org.activityinfo.model.form.FormInstance)4 FieldValue (org.activityinfo.model.type.FieldValue)4 ActivityInfoClient (org.activityinfo.client.ActivityInfoClient)2 JsonValue (org.activityinfo.json.JsonValue)2 VisibleForTesting (com.google.common.annotations.VisibleForTesting)1 KeyGenerator (org.activityinfo.model.legacy.KeyGenerator)1 ColumnSet (org.activityinfo.model.query.ColumnSet)1 ColumnView (org.activityinfo.model.query.ColumnView)1 QueryModel (org.activityinfo.model.query.QueryModel)1 ResourceId (org.activityinfo.model.resource.ResourceId)1 RecordRef (org.activityinfo.model.type.RecordRef)1 GeoPoint (org.activityinfo.model.type.geo.GeoPoint)1 TypedRecordUpdate (org.activityinfo.store.spi.TypedRecordUpdate)1 FormInputModel (org.activityinfo.ui.client.input.model.FormInputModel)1