Skip to content

Commit

Permalink
remove extra div (Hacker0x01#1491)
Browse files Browse the repository at this point in the history
* remove extra div

* test with enzyme
  • Loading branch information
bertho-zero authored and martijnrusschen committed Oct 22, 2018
1 parent 01c5606 commit df59d1d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
2 changes: 0 additions & 2 deletions src/popper_component.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ export default class PopperComponent extends React.Component {
}

return (
<div>
<Manager>
<Reference>
{({ ref }) => (
Expand All @@ -88,7 +87,6 @@ export default class PopperComponent extends React.Component {
</Reference>
{popper}
</Manager>
</div>
);
}
}
14 changes: 6 additions & 8 deletions test/datepicker_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,16 +83,14 @@ describe("DatePicker", () => {
});

it("should pass a custom class to the popper container", () => {
var datePicker = TestUtils.renderIntoDocument(
<DatePicker popperClassName="some-class-name" />
);
var dateInput = datePicker.input;
var datePicker = mount(<DatePicker popperClassName="some-class-name" />);
var dateInput = datePicker.instance().input;
TestUtils.Simulate.focus(ReactDOM.findDOMNode(dateInput));

const element = ReactDOM.findDOMNode(datePicker);
const popper = element.querySelector(".react-datepicker-popper");
expect(popper).to.exist;
expect(popper.className).to.contain("some-class-name");
datePicker.update();
const popper = datePicker.find(".react-datepicker-popper");
expect(popper.length).to.equal(1);
expect(popper.hasClass("some-class-name")).to.equal(true);
});

it("should show the calendar when clicking on the date input", () => {
Expand Down

0 comments on commit df59d1d

Please sign in to comment.