diff --git a/packages/marble-checkbox-group/src/CheckboxGroup.js b/packages/marble-checkbox-group/src/CheckboxGroup.js index 02fff2a..8185c90 100644 --- a/packages/marble-checkbox-group/src/CheckboxGroup.js +++ b/packages/marble-checkbox-group/src/CheckboxGroup.js @@ -27,14 +27,14 @@ CheckboxGroup.STATE = { label: Config.string(), value: Config.string(), }) - ).required(), + ), /** * The name param used on each radio * @type {?String} * @default undefined */ - name: Config.string().required(), + name: Config.string(), /** * The style of the radio group diff --git a/packages/marble-checkbox-group/src/CheckboxGroup.soy b/packages/marble-checkbox-group/src/CheckboxGroup.soy index c396147..2f5c218 100644 --- a/packages/marble-checkbox-group/src/CheckboxGroup.soy +++ b/packages/marble-checkbox-group/src/CheckboxGroup.soy @@ -4,22 +4,24 @@ * This renders the component's whole content. */ {template .render} - {@param items: list} + {@param? items: list} {@param? name: string} {@param? style: string}
- {foreach $item in $items} - {let $checkedAttr kind="attributes"} - {if $item.checked} - checked="checked" - {/if} - {/let} + {if $items} + {foreach $item in $items} + {let $checkedAttr kind="attributes"} + {if $item.checked} + checked="checked" + {/if} + {/let} -
- - -
- {/foreach} +
+ + +
+ {/foreach} + {/if}
{/template} diff --git a/packages/marble-checkbox-group/test/CheckboxGroup.node.js b/packages/marble-checkbox-group/test/CheckboxGroup.node.js new file mode 100644 index 0000000..725e6c4 --- /dev/null +++ b/packages/marble-checkbox-group/test/CheckboxGroup.node.js @@ -0,0 +1,13 @@ +/** + * @jest-environment node + */ + +import Component from 'metal-component'; +import CheckboxGroup from '../src/CheckboxGroup'; + +describe('CheckboxGroup.node', () => { + it('should not fail on the server side', () => { + const checkboxGroup = Component.renderToString(CheckboxGroup); + expect(checkboxGroup).not.toBeNull(); + }); +});