diff --git a/src/generator.js b/src/generator.js
index 4f8be39..44dffee 100644
--- a/src/generator.js
+++ b/src/generator.js
@@ -24,8 +24,9 @@ function generator(fn, argArray, options) {
return componentProps[element];
});
- // Get value from this.props.children.
- this.args[0] = this.props.children;
+ // Get value from this.props.value if set else from
+ // this.props.children.
+ this.args[0] = this.props.hasOwnProperty("value") ? this.props.value : this.props.children;
if (this.props["locale"]) {
this.instance = Globalize(this.props["locale"]);
diff --git a/test/general.spec.js b/test/general.spec.js
index c7ddb1f..5f0341f 100755
--- a/test/general.spec.js
+++ b/test/general.spec.js
@@ -6,4 +6,14 @@ describe("General Functionality Tests", () => {
const wrapper = shallow({150});
expect(wrapper.text()).to.equal("150,00 €");
});
+
+ it("uses value prop instead of children to display $200.00", () => {
+ const wrapper = shallow({150});
+ expect(wrapper.text()).to.equal("$200.00");
+ });
+
+ it("uses value prop instead of children to display $0.00 even though 0 is falsey", () => {
+ const wrapper = shallow({150});
+ expect(wrapper.text()).to.equal("$0.00");
+ });
});