From e53e306125e18da15b46c6c756abba6b1382e501 Mon Sep 17 00:00:00 2001 From: Brad Dunbar Date: Tue, 18 Apr 2017 20:10:22 -0400 Subject: [PATCH] Add test for rendering a component with text nodes The implementation of `h` suggests that textual children of components should not be merged. However, there is no test coverage of this behavior. --- test/shared/h.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/shared/h.js b/test/shared/h.js index 50000deecd..9a58637a07 100644 --- a/test/shared/h.js +++ b/test/shared/h.js @@ -208,4 +208,13 @@ describe('h(jsx)', () => { .with.property('children') .that.deep.equals(['onetwothree']); }); + + it('should not merge children of components', () => { + let Component = ({children}) => children; + let r = h(Component, null, 'x', 'y'); + + expect(r).to.be.an('object') + .with.property('children') + .that.deep.equals(['x', 'y']); + }); });