<commit_before>// don"t mock our CUT or components it depends on
jest.dontMock("../src/components/Popover");
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 Popover = require("../src/components/Popover").default;


describe("Popover", () => {
  it("Does render a Popover", () => {
    const text = "howdy";

    // Render a Popover
    const popovertComponent = TestUtils.renderIntoDocument(
        <Popover open={true}>{text}</Popover>
    );

    // grab the DOM node so we can inspect it
    const popoverNode = ReactDOM.findDOMNode(popovertComponent);

    // Verify that it"s rendered with the right text
    expect(popoverNode.textContent).toEqual(text);

  });

});<commit_msg>Tests for Popover open/closed states<commit_after>// don"t mock our CUT or components it depends on
jest.dontMock("../src/components/Popover");
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 Popover = require("../src/components/Popover").default;


describe("Popover", () => {
  it("Does render a Popover", () => {
    const text = "howdy";

    // Render a Popover
    const popovertComponent = TestUtils.renderIntoDocument(
        <Popover open={true}>{text}</Popover>
    );

    // grab the DOM node so we can inspect it
    const popoverNode = ReactDOM.findDOMNode(popovertComponent);

    // Verify that it"s rendered with the right text
    expect(popoverNode.textContent).toEqual(text);

  });

  it("Does render an open Popover", () => {
    // Render a Popover
    const popovertComponent = TestUtils.renderIntoDocument(
        <Popover open={true}/>
    );

    // grab the DOM node so we can inspect it
    const popoverNode = ReactDOM.findDOMNode(popovertComponent);

    // Verify that it"s rendered with the right text
    expect(popoverNode.style.display).toEqual("block");
  });

  it("Does render a closed Popover", () => {
    // Render a Popover
    const popovertComponent = TestUtils.renderIntoDocument(
        <Popover/>
    );

    // grab the DOM node so we can inspect it
    const popoverNode = ReactDOM.findDOMNode(popovertComponent);

    // Verify that it"s rendered with the right text
    expect(popoverNode.style.display).toEqual("none");
  });

});
{'fraction_non_alphanumeric': 0.1255497800879648, 'fraction_numerical': 0.0007996801279488205, 'mean_word_length': 3.4919210053859966, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 15, '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': '3189067', 'n_tokens_mistral': 750, 'n_tokens_neox': 739, 'n_words': 223}