Created
April 29, 2016 13:39
-
-
Save ryanluker/e4c8647c3822767ed14e5c9d48e82994 to your computer and use it in GitHub Desktop.
testing price label and nested requires
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jest.dontMock("../PriceLabel"); | |
jest.dontMock("../../libs/helpers"); | |
import * as React from "react"; | |
import * as ReactDOM from "react-dom"; | |
import * as TestUtils from "react-addons-test-utils"; | |
import {PriceLabel} from "../PriceLabel"; | |
describe("PriceLabel", () => { | |
it("Renders and has nice looking price", () => { | |
let PriceLabelStateless = TestUtils.renderIntoDocument( | |
<div><PriceLabel price={120} /></div> | |
); | |
expect(TestUtils.isDOMComponent(PriceLabelStateless)).toBeTruthy(); | |
expect(ReactDOM.findDOMNode(PriceLabelStateless).textContent).toBe("$1.20"); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment