import React__default from 'react';
import { jsxTextContent } from '../util.js';

describe("jsXTextContent", function () {
  it("returns an empty string if children is null", function () {
    expect(jsxTextContent(null)).toEqual("");
  });
  it("returns the passed argument if it is a string", function () {
    expect(jsxTextContent("foo")).toEqual("foo");
  });
  it("returns the text content of the children", function () {
    var children = ["foo", /*#__PURE__*/React__default.createElement("div", {
      key: "a"
    }, "bar", /*#__PURE__*/React__default.createElement("div", null, "baz")), "qux"];
    expect(jsxTextContent(children)).toEqual("foobarbazqux");
  });
  it("returns the text content of the children recursively", function () {
    var children = ["foo", /*#__PURE__*/React__default.createElement("div", {
      key: "a"
    }, "bar", /*#__PURE__*/React__default.createElement("div", null, "baz")), /*#__PURE__*/React__default.createElement("div", {
      key: "b"
    }, "qux", /*#__PURE__*/React__default.createElement("div", null, "quux"))];
    expect(jsxTextContent(children)).toEqual("foobarbazquxquux");
  });
});
