<commit_before>// don"t mock our CUT or components it depends on
jest.dontMock("../src/components/List");
jest.dontMock("../src/components/ListItem");
jest.dontMock("../src/components/Text");
jest.dontMock("reactcss");

import React from "react";
import ReactDOM from "react-dom";
import TestUtils from "react-addons-test-utils";

// TODO: move this to es6 style import when its implemented in jest
const List = require("../src/components/List").default;
const ListItem = require("../src/components/ListItem").default;
const Text = require("../src/components/Text").default;

describe("List", () => {
  it("Does render a List", () => {
    const listItems = ["Item 1", "Item 2"];

    const list = TestUtils.renderIntoDocument(
        <List>
          {listItems.map((item, i) => {
            return (
                <Text key={i}>{item}</Text>
            )
          })}
        </List>
    );

    // grab the DOM node so we can inspect it
    TestUtils.scryRenderedDOMComponentsWithTag(list, "span").forEach((item,i) => {
      expect(item.textContent).toEqual(listItems[i]);
    });
  });

  it("Does trigger an event when list is clicked", (done) => {
    const listItems = ["Item 1", "Item 2"];

    const list = TestUtils.renderIntoDocument(
        <List onClick={() => done()} /><commit_msg>simplify List tests further<commit_after>// don"t mock our CUT or components it depends on
jest.dontMock("../src/components/List");
jest.dontMock("reactcss");

import React from "react";
import ReactDOM from "react-dom";
import TestUtils from "react-addons-test-utils";

// TODO: move this to es6 style import when its implemented in jest
const List = require("../src/components/List").default;

describe("List", () => {
  it("Does render a List", () => {
    const listItems = ["Item 1", "Item 2"];

    const list = TestUtils.renderIntoDocument(
        <List>
          {listItems.map((item, i) => {
            return (
                <span key={i}>{item}</span>
            )
          })}
        </List>
    );

    // grab the DOM node so we can inspect it
    TestUtils.scryRenderedDOMComponentsWithTag(list, "span").forEach((item,i) => {
      expect(item.textContent).toEqual(listItems[i]);
    });
  });

  it("Does trigger an event when list is clicked", (done) => {

    const list = TestUtils.renderIntoDocument(
        <List onClick={() => done()} />
{'fraction_non_alphanumeric': 0.1639966273187184, 'fraction_numerical': 0.003372681281618887, 'mean_word_length': 2.9484193011647255, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5180672', 'n_tokens_mistral': 723, 'n_tokens_neox': 700, 'n_words': 191}