2023-11-21 17:19:43 +00:00
|
|
|
import { expect } from 'chai';
|
2023-11-21 17:21:41 +00:00
|
|
|
import convert from '../vnode-children.js';
|
2023-11-21 17:19:43 +00:00
|
|
|
|
|
|
|
describe('experimental react children', () => {
|
2023-11-21 17:21:41 +00:00
|
|
|
it('has undefined as children for direct children', () => {
|
|
|
|
const [imgVNode] = convert('<img src="abc"></img>');
|
|
|
|
expect(imgVNode.props).to.deep.include({ children: undefined });
|
|
|
|
});
|
2023-11-21 17:19:43 +00:00
|
|
|
|
2023-11-21 17:21:41 +00:00
|
|
|
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 });
|
|
|
|
});
|
|
|
|
});
|