Skip to content

Commit 48f23e7

Browse files
Copilotrenemadsen
andcommitted
Fix unit tests by adding formGroup wrapper to GeneralTabComponent template
- Wrapped entire GeneralTabComponent template content with <div [formGroup]="assignedSiteForm"> - This provides form context for all formControlName directives within the component - Removed redundant formGroup wrapper from parent template - Fixes unit test error: "formControlName must be used with a parent formGroup directive" Co-authored-by: renemadsen <[email protected]>
1 parent 810d8e4 commit 48f23e7

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

eform-client/src/app/plugins/modules/time-planning-pn/components/plannings/time-planning-actions/assigned-site/assigned-site-dialog.component.html

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,12 @@
44
dynamicHeight="false"
55
>
66
<mat-tab label="{{'General' | translate }}" >
7-
<div [formGroup]="assignedSiteForm">
8-
<app-assigned-site-general-tab
9-
[data]="data"
10-
[assignedSiteForm]="assignedSiteForm"
11-
[isFirstUser]="isFirstUser"
12-
[isAdmin]="isAdmin">
13-
</app-assigned-site-general-tab>
14-
</div>
7+
<app-assigned-site-general-tab
8+
[data]="data"
9+
[assignedSiteForm]="assignedSiteForm"
10+
[isFirstUser]="isFirstUser"
11+
[isAdmin]="isAdmin">
12+
</app-assigned-site-general-tab>
1513
</mat-tab>
1614
<mat-tab label="{{'Plan hours' | translate }} "
1715
*ngIf="data.useOnlyPlanHours && !data.useGoogleSheetAsDefault && isFirstUser">

eform-client/src/app/plugins/modules/time-planning-pn/components/plannings/time-planning-actions/assigned-site/tabs/general-tab.component.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<div [formGroup]="assignedSiteForm">
12
<div class="d-flex flex-row" *ngIf="!data.resigned && isFirstUser">
23
<!-- data.useGoogleSheetAsDefault -->
34
<mat-checkbox class="p-1"
@@ -164,3 +165,4 @@
164165
</mat-error>
165166
</mat-form-field>
166167
</div>
168+
</div>

0 commit comments

Comments
 (0)