From 1b7c48e4a97601a135cc44aa38474de72a55b528 Mon Sep 17 00:00:00 2001 From: Gary Thomas Date: Thu, 5 Apr 2018 17:28:00 -0700 Subject: [PATCH] gt - Correct required indicator --- src/components/FormLabelGroup.js | 3 ++- src/components/FormRow.js | 1 + test/components/FormLabelGroup.spec.js | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/FormLabelGroup.js b/src/components/FormLabelGroup.js index be1066f41..a6f3f483a 100644 --- a/src/components/FormLabelGroup.js +++ b/src/components/FormLabelGroup.js @@ -5,6 +5,7 @@ import FormGroup from './FormGroup'; import FormText from './FormText'; import FormFeedback from './FormFeedback'; import Label from './Label'; +import Required from './Required'; import Row from './Row'; const FormLabelGroup = (props) => { @@ -32,7 +33,7 @@ const FormLabelGroup = (props) => { {label && ( )} diff --git a/src/components/FormRow.js b/src/components/FormRow.js index d375353a9..0401de80c 100644 --- a/src/components/FormRow.js +++ b/src/components/FormRow.js @@ -61,6 +61,7 @@ const FormRow = (props) => { const inputContainerWidth = stacked ? 12 : 9; + // TODO this should use FormLabelGroup vs duplicated code here: return ( ', () => { assert.equal(label.length, 1); const labelChildren = label.children(); assert.equal(labelChildren.at(0).text(), 'First Name'); - assert.equal(labelChildren.at(1).text(), ' *'); - assert.equal(labelChildren.at(1).prop('className'), 'text-danger'); + const star = label.find('Required'); + assert.equal(star.length, 1); }); });