forked from reactjs/react-modal
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Mike Deverell
committed
Oct 15, 2018
1 parent
9cd0891
commit 6a67946
Showing
2 changed files
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import ReactDOM from "react-dom"; | ||
import sinon from "sinon"; | ||
import { | ||
mcontent, | ||
renderModal, | ||
emptyDOM | ||
} from "./helper"; | ||
|
||
export default () => { | ||
afterEach("cleaned up all rendered modals", emptyDOM); | ||
|
||
it("renders as expected, initially", () => { | ||
const modal = renderModal({ isOpen: true }, "hello"); | ||
mcontent(modal).should.be.ok(); | ||
}); | ||
|
||
it("allows ReactDOM.createPortal to be overridden in real-time", () => { | ||
const createPortalSpy = sinon.spy(ReactDOM, "createPortal"); | ||
renderModal({ isOpen: true }, "hello"); | ||
createPortalSpy.called.should.be.ok(); | ||
ReactDOM.createPortal.restore(); | ||
}); | ||
}; |
This file contains 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