+
+
+
+
@if (fieldHasError && isRequired) {
-
+
{{ 'dot.edit.content.form.field.required' | dm }}
}
- @if (!fieldHasError && !hasTimezone && hasHint) {
+ @if (hasHint) {
+ class="p-field-hint text-sm text-gray-500"
+ [attr.data-testId]="'hint-' + field.variable">
{{ field.hint }}
}
- @if (!fieldHasError && hasTimezone && hasHint) {
-
- {{ systemTimezone.label }}
-
- }
diff --git a/core-web/libs/edit-content/src/lib/fields/dot-edit-content-calendar-field/dot-edit-content-calendar-field.component.spec.ts b/core-web/libs/edit-content/src/lib/fields/dot-edit-content-calendar-field/dot-edit-content-calendar-field.component.spec.ts
index f3b36fd59735..a3df0fce25c5 100644
--- a/core-web/libs/edit-content/src/lib/fields/dot-edit-content-calendar-field/dot-edit-content-calendar-field.component.spec.ts
+++ b/core-web/libs/edit-content/src/lib/fields/dot-edit-content-calendar-field/dot-edit-content-calendar-field.component.spec.ts
@@ -69,34 +69,43 @@ describe('DotEditContentCalendarFieldComponent', () => {
expireDateVar: null
};
- describe('Calendar field timezone information', () => {
- it('should show timezone info for DATE_AND_TIME fields when timezone is provided', () => {
- spectator = createHost(
- `
`,
- {
- hostProps: {
- formGroup: new FormGroup({
- [DATE_FIELD_MOCK.variable]: new FormControl()
- }),
- field: { ...DATE_FIELD_MOCK, fieldType: FIELD_TYPES.DATE_AND_TIME },
- utcTimezone: MOCK_TIMEZONE,
- contentType: CONTENT_TYPE_WITHOUT_EXPIRE,
- contentlet: createFakeContentlet({
- [DATE_FIELD_MOCK.variable]: null
- })
+ // The 'Calendar field timezone information' suite that lived here tested the timezone line
+ // under the input. FR-009 removes that line entirely — the timezone now renders inside the
+ // picker footer, so its coverage moved to calendar-field.component.spec.ts ('Picker footer —
+ // timezone'). What remains here is the guarantee that nothing renders under the input.
+ describe('Calendar field timezone placement', () => {
+ it.each([FIELD_TYPES.DATE_AND_TIME, FIELD_TYPES.TIME, FIELD_TYPES.DATE])(
+ 'should NOT render a timezone line under the input for a %s field',
+ (fieldType) => {
+ const field = { ...DATE_FIELD_MOCK, fieldType };
+
+ spectator = createHost(
+ `
`,
+ {
+ hostProps: {
+ formGroup: new FormGroup({
+ [field.variable]: new FormControl()
+ }),
+ field,
+ utcTimezone: MOCK_TIMEZONE,
+ contentType: CONTENT_TYPE_WITHOUT_EXPIRE,
+ contentlet: createFakeContentlet({ [field.variable]: null })
+ }
}
- }
- );
- spectator.detectChanges();
+ );
+ spectator.detectChanges();
- const timezoneElement = spectator.query(byTestId('calendar-field-timezone'));
- expect(timezoneElement).toExist();
- expect(timezoneElement).toContainText(MOCK_TIMEZONE.label);
- });
+ expect(spectator.query(byTestId('calendar-field-timezone'))).not.toExist();
+ }
+ );
+ });
+
+ describe('Calendar field hint', () => {
+ it('should NOT show hint when field has no hint property', () => {
+ const fieldWithoutHint = { ...DATE_FIELD_MOCK, hint: undefined };
- it('should show timezone info for TIME fields when timezone is provided', () => {
spectator = createHost(
`