pseudo-code of my parentComponent html:
<mat-tab-group class="mat-elevation-z4">
<mat-tab label="OneBox">
<host-configuration [hostTemplate]="shareNodes">
</host-configuration>
</mat-tab>
</mat-tab-group>
I am creating an instance of child component using it's selector(host-configuration) to create form fields where user can give the values.
Code in childComponent(host-configuration) which will create UI form fields
@Input()
set hostTemplate(value: HostTemplate) {
this.loadedTemplate = value ?? new HostTemplate();
this.templateNameConfigItem.formControl.setValue(value.TemplateName);
this.vmStubNameConfigItem.formControl.setValue(value.VMStubName);
this.virtualApplianceConfigItem.formControl.setValue(value.VirtualAppliance);
this.cpuCountConfigItem.formControl.setValue(value.Sizing.cpu_count);
this.numOfCoresPerSocketConfigItem.formControl.setValue(value.Sizing.num_cores_per_socket);
this.ramInMBConfigItem.formControl.setValue(value.Sizing.ram_mb);
if (value.VMs.length > 0) {
this.hostNameConfigItem.formControl.setValue(value.VMs[0]?.ComputerName);
this.ipAddressConfigItem.formControl.setValue(value.VMs[0]?.Ip);
this.macAddressConfigItem.formControl.setValue(value.VMs[0]?.Mac);
}
this.diskConfigurationItems.length = 0;
for (const d of value.Disks) {
this.diskConfigurationItems.push(new DiskConfigurationItems(d));
}
}
Now I want to test this particular UI form elements of child component (host-configuration) in parent component spec file?
Is there a way to do this , if yes could you please help me on how to do it ?