Skip to content

Commit

Permalink
fix(circle-toggle): addition check error state from group (#1197)
Browse files Browse the repository at this point in the history
* fix(circle-toggle): addition check error state from group

* fix(circle-toggle): add test

* fix(circle-toggle): remove unused style
  • Loading branch information
vt-allianz authored and GitHub Enterprise committed May 29, 2024
1 parent 5e6bca0 commit 01e518f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,3 @@
flex-direction: row;
}
}

:host(.has-error) {
::ng-deep .nx-toggle-circle__icon-wrapper {
border-color: v(danger);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,13 @@ describe('NxToggleButtonGroup', () => {
reactComp.testGroup.controls.reactiveToggle.setValue(null);
reactComp.testGroup.markAllAsTouched();
fixture.detectChanges();
const children = fixture.nativeElement.querySelectorAll('.nx-toggle-circle');

tick();

children.forEach((child: any) => {
expect(child).toHaveClass('has-error');
});
expect(toggleComponent.errorState).toBeTrue();
}));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ let nextId = 0;
'[class.in-group]': 'inGroup',
'[class.is-disabled]': 'disabled',
'[class.is-responsive]': 'responsive',
'[class.has-error]': 'errorState',
'[class.has-error]': 'toggleGroup?.errorState || errorState',
},
})
export class NxCircleToggleComponent extends ToggleButton implements OnDestroy, AfterViewInit, ControlValueAccessor, DoCheck {
Expand Down

0 comments on commit 01e518f

Please sign in to comment.