import React from "react";
import renderer from "react-test-renderer";

import TransformVDOM from "../src";

describe("transform-vdom", () => {
  test("can render", () => {
    const component = renderer.create(
      <TransformVDOM
        data={{
          tagName: "div",
          attributes: { style: { color: "DeepPink" } },
          children: [
            { tagName: "h1", attributes: {}, children: "Wahoo" },
            { tagName: "h1", attributes: {}, children: null },
            {
              tagName: "img",
              attributes: {
                width: "100px",
                height: "100px",
                src: "about:blank"
              },
              children: []
            }
          ]
        }}
      />
    );

    expect(component.toJSON()).toMatchSnapshot();
  });
});
