diff options
author | 2023-11-22 22:37:18 +0800 | |
---|---|---|
committer | 2023-11-22 22:37:18 +0800 | |
commit | 19fd19f3934a115471e5caff08fe5b8ba404b739 (patch) | |
tree | 8802cfef36ad13cfe9b9b24b3480d4612cf3f76e /packages/integrations/react/test/parsed-react-children.test.js | |
parent | 710be505c9ddf416e77a75343d8cae9c497d72c6 (diff) | |
parent | 4d1274c47987bf3c247f0ad02309f3c2b9968d6e (diff) | |
download | astro-19fd19f3934a115471e5caff08fe5b8ba404b739.tar.gz astro-19fd19f3934a115471e5caff08fe5b8ba404b739.tar.zst astro-19fd19f3934a115471e5caff08fe5b8ba404b739.zip |
Merge branch 'main' into next
Diffstat (limited to 'packages/integrations/react/test/parsed-react-children.test.js')
-rw-r--r-- | packages/integrations/react/test/parsed-react-children.test.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/packages/integrations/react/test/parsed-react-children.test.js b/packages/integrations/react/test/parsed-react-children.test.js new file mode 100644 index 000000000..1c845836f --- /dev/null +++ b/packages/integrations/react/test/parsed-react-children.test.js @@ -0,0 +1,15 @@ +import { expect } from 'chai'; +import convert from '../vnode-children.js'; + +describe('experimental react children', () => { + it('has undefined as children for direct children', () => { + const [imgVNode] = convert('<img src="abc"></img>'); + expect(imgVNode.props).to.deep.include({ children: undefined }); + }); + + it('has undefined as children for nested children', () => { + const [divVNode] = convert('<div><img src="xyz"></img></div>'); + const [imgVNode] = divVNode.props.children; + expect(imgVNode.props).to.deep.include({ children: undefined }); + }); +}); |