Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanseddon committed May 24, 2024
1 parent 3adfb51 commit 992810d
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/Frame.spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,23 @@ describe('The Frame Component', () => {
);
});

it("should render null when `this.getMountTarget()` can't resolve", done => {
const didMount = sinon.spy();
const getMountTarget = sinon
.stub(Frame.prototype, 'getMountTarget')
.returns(null);

div = document.body.appendChild(document.createElement('div'));

ReactDOM.render(<Frame contentDidMount={didMount} />, div);

setTimeout(() => {
expect(didMount.callCount).to.equal(0);
done();
getMountTarget.restore();
}, 100);
});

it('should not error when parent components are reused', done => {
div = document.body.appendChild(document.createElement('div'));

Expand Down

0 comments on commit 992810d

Please sign in to comment.