Skip to content

Commit

Permalink
test(Map): add render spec for style
Browse files Browse the repository at this point in the history
  • Loading branch information
tomchentw committed Oct 26, 2014
1 parent 3264d7d commit 61a9688
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions src/__tests__/Map-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/** @jsx React.DOM */
"use strict";

jest.dontMock("../Map.js");
jest.dontMock("../GoogleMapsMixin.js");
jest.dontMock("../mixins/ChildMixin.js");
jest.dontMock("../mixins/EventBindingMixin.js");

describe("Map", function() {
it("should render a canvas", function() {
var React = require("react/addons"),
Map = require("../Map.js"),
{TestUtils} = React.addons,
MockContext,
map,
divCanvas;

MockContext = React.createClass({
mixins: [require("../GoogleMapsMixin")],

render () {
return <div><Map /></div>;
}
});

map = TestUtils.findRenderedComponentWithType(
TestUtils.renderIntoDocument(<MockContext />),
Map
);

divCanvas = TestUtils.findRenderedDOMComponentWithTag(
map, "div"
);

expect(divCanvas.getDOMNode().getAttribute("style")).toEqual("width:100%;height:400px;");
});
});

0 comments on commit 61a9688

Please sign in to comment.