From 24e2524021fda4171fa6831cc9347d08e5b48bc0 Mon Sep 17 00:00:00 2001 From: Zeno Rocha Date: Fri, 16 Feb 2018 16:27:09 -0800 Subject: [PATCH] Makes RadioGroup SSR compatible #66 --- packages/marble-radio-group/src/RadioGroup.js | 4 +-- .../marble-radio-group/src/RadioGroup.soy | 26 ++++++++++--------- .../test/RadioGroup.node.js | 13 ++++++++++ 3 files changed, 29 insertions(+), 14 deletions(-) create mode 100644 packages/marble-radio-group/test/RadioGroup.node.js diff --git a/packages/marble-radio-group/src/RadioGroup.js b/packages/marble-radio-group/src/RadioGroup.js index b185a44..07c8911 100644 --- a/packages/marble-radio-group/src/RadioGroup.js +++ b/packages/marble-radio-group/src/RadioGroup.js @@ -27,14 +27,14 @@ RadioGroup.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-radio-group/src/RadioGroup.soy b/packages/marble-radio-group/src/RadioGroup.soy index c116708..e289f0a 100644 --- a/packages/marble-radio-group/src/RadioGroup.soy +++ b/packages/marble-radio-group/src/RadioGroup.soy @@ -4,22 +4,24 @@ * */ {template .render} - {@param items: list} + {@param? items: list} {@param? name: string} {@param? style: string} {/template} diff --git a/packages/marble-radio-group/test/RadioGroup.node.js b/packages/marble-radio-group/test/RadioGroup.node.js new file mode 100644 index 0000000..3822b9f --- /dev/null +++ b/packages/marble-radio-group/test/RadioGroup.node.js @@ -0,0 +1,13 @@ +/** + * @jest-environment node + */ + +import Component from 'metal-component'; +import RadioGroup from '../src/RadioGroup'; + +describe('RadioGroup.node', () => { + it('should not fail on the server side', () => { + const radioGroup = Component.renderToString(RadioGroup); + expect(radioGroup).not.toBeNull(); + }); +});