mirror of
https://github.com/withastro/astro.git
synced 2025-01-06 22:10:10 -05:00
af43fb5172
* add test script * make children `undefined` with self-closing tags * add changeset * refactor: simplify
15 lines
607 B
JavaScript
15 lines
607 B
JavaScript
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 });
|
|
})
|
|
})
|