diff --git a/lib/core/form/components/widgets/checkbox/checkbox.widget.html b/lib/core/form/components/widgets/checkbox/checkbox.widget.html index 0705bda422..4c80eef031 100644 --- a/lib/core/form/components/widgets/checkbox/checkbox.widget.html +++ b/lib/core/form/components/widgets/checkbox/checkbox.widget.html @@ -1,4 +1,5 @@ -
+
{ + + let widget: CheckboxWidgetComponent; + let fixture: ComponentFixture; + let element: HTMLElement; + + setupTestBed({ + imports: [ + NoopAnimationsModule, + FormBaseModule + ], + providers: [ + TranslateStore, + TranslateService, + { provide: TranslateLoader, useClass: TranslateLoaderService } + ] + }); + + beforeEach(() => { + fixture = TestBed.createComponent(CheckboxWidgetComponent); + + widget = fixture.componentInstance; + element = fixture.nativeElement; + }); + + describe('when template is ready', () => { + + beforeEach(() => { + widget.field = new FormFieldModel(new FormModel({taskId: 'fake-task-id'}), { + id: 'check-id', + name: 'check-name', + value: '', + type: FormFieldTypes.BOOLEAN, + readOnly: false, + required: true + }); + fixture.detectChanges(); + }); + + it('should be marked as invalid when required', async(() => { + fixture.whenStable().then(() => { + expect(element.querySelector('.adf-invalid')).not.toBeNull(); + }); + })); + + }); +}); diff --git a/lib/core/form/components/widgets/form.scss b/lib/core/form/components/widgets/form.scss index 2b83e150d5..70692a4726 100644 --- a/lib/core/form/components/widgets/form.scss +++ b/lib/core/form/components/widgets/form.scss @@ -43,6 +43,24 @@ background-color: #f44336 !important; } + .mat-checkbox { + color: mat-color($warn); + .mat-checkbox-frame { + border-color: mat-color($warn); + } + } + + .mat-select { + + &-value { + color: mat-color($warn); + } + &-arrow { + color: mat-color($warn); + } + + } + .adf-file { border-color: mat-color($warn); }