/**
 * Ported from Gutenberg code
 * @see README.md
 */

/**
 * Internal dependencies
 */
import { fromDOM } from './children';

describe('fromDOM', () => {
  it('should return an equivalent block children', () => {
    const node = document.createElement('div');
    node.innerHTML = 'This <strong class="is-extra-strong">is</strong> a test';

    const blockNode = fromDOM(node.childNodes);

    expect(blockNode).toEqual([
      'This ',
      {
        type: 'strong',
        props: {
          class: 'is-extra-strong',
          children: ['is'],
        },
      },
      ' a test',
    ]);
  });
});
