{"size": 760, "ext": "js", "max_stars_repo_path": "lib/nest/__tests__/nest.test.js", "max_stars_repo_name": "mattcarlotta/composable-styled-components", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "lib/nest/__tests__/nest.test.js", "max_issues_repo_name": "mattcarlotta/composable-styled-components", "max_issues_repo_issues_event_min_datetime": "2020-08-27T21:07:54.000Z", "max_issues_repo_issues_event_max_datetime": "2020-08-27T21:07:54.000Z", "max_forks_repo_path": "lib/nest/__tests__/nest.test.js", "max_forks_repo_name": "mattcarlotta/composable-styled-components", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 1, "max_forks_count": null, "avg_line_length": 21.1111111111, "max_line_length": 69, "alphanum_fraction": 0.6197368421}
import { compose } from "~lib";
import { nest } from "../index";

const Container = compose.main()`
  padding: 20px;
`;

const Body = compose.div()`
  margin: 0;
  padding: 0;
`;

const Title = compose.h1()`
  text-decoration: uppercase;
`;

const ContainedBodyTitle = nest(Container, Body, Title);

describe("Nest Function", () => {
  let wrapper;
  beforeEach(() => {
    wrapper = mount(<ContainedBodyTitle />);
  });

  it("renders without errors", () => {
    expect(wrapper).toExist();
    expect(wrapper.find("main")).toExist();
    expect(wrapper.find("div")).toExist();
    expect(wrapper.find("h1")).toExist();
  });

  it("nests components from left to right", () => {
    expect(wrapper.find(Container).find(Body).find(Title)).toExist();
  });
});
