0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-23 21:53:55 -05:00
astro/packages/integrations/react/test/parsed-react-children.test.js

17 lines
604 B
JavaScript
Raw Normal View History

import assert from 'node:assert/strict';
import { describe, it } from 'node:test';
2023-11-21 12:21:41 -05:00
import convert from '../vnode-children.js';
describe('experimental react children', () => {
2023-11-21 12:21:41 -05:00
it('has undefined as children for direct children', () => {
const [imgVNode] = convert('<img src="abc"></img>');
assert.deepStrictEqual(imgVNode.props.children, undefined);
2023-11-21 12:21:41 -05:00
});
2023-11-21 12:21:41 -05:00
it('has undefined as children for nested children', () => {
const [divVNode] = convert('<div><img src="xyz"></img></div>');
const [imgVNode] = divVNode.props.children;
assert.deepStrictEqual(imgVNode.props.children, undefined);
2023-11-21 12:21:41 -05:00
});
});