feat(validator): add validation support for RadioGroup
(#234)
* Removed div element from RadioGroup * Fixed first RadioGroup unit test
This commit is contained in:
parent
25ce684d23
commit
5aa7c19874
2 changed files with 4 additions and 5 deletions
|
@ -21,10 +21,9 @@ const options = control.options.map((option: string | ControlOption) => {
|
|||
return option;
|
||||
});
|
||||
---
|
||||
|
||||
<br>
|
||||
{
|
||||
options.map((option: ControlOption, index: number) => (
|
||||
<div class="radio-option">
|
||||
<input
|
||||
type="radio"
|
||||
id={control.id + '-' + index}
|
||||
|
@ -36,6 +35,6 @@ const options = control.options.map((option: string | ControlOption) => {
|
|||
data-validation-on={control.triggerValidationOn ? control.triggerValidationOn : null}
|
||||
/>
|
||||
<label for={control.id + '-' + index}>{option.label}</label>
|
||||
</div>
|
||||
<br>
|
||||
))
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ describe('RadioGroup.astro test', () => {
|
|||
it('Should render all radio options', async () => {
|
||||
// arrange
|
||||
const expectedOptions = 3;
|
||||
const element = /radio-option/g;
|
||||
const element = /type="radio"/g;
|
||||
const props = {
|
||||
control: {
|
||||
label: 'FAKE LABEL',
|
||||
|
|
Loading…
Reference in a new issue