Skip to content

Commit

Permalink
[fbjs] Test getActiveElement api change (facebook#156)
Browse files Browse the repository at this point in the history
  • Loading branch information
acusti committed Oct 6, 2016
1 parent a28ba36 commit 80dad7c
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packages/fbjs/src/core/dom/__tests__/getActiveElement-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,17 @@ describe('getActiveElement', () => {
var element = getActiveElement();
expect(element.tagName).toEqual('BODY');
});

it('uses optional document parameter when provided', () => {
var iframe = document.createElement('iframe');
document.body.appendChild(iframe);
var iframeDocument = iframe.contentDocument;
var element = getActiveElement(iframeDocument);
try {
expect(element.ownerDocument).toBe(iframeDocument);
expect(element.ownerDocument).not.toBe(document);
} finally {
document.body.removeChild(iframe);
}
});
});

0 comments on commit 80dad7c

Please sign in to comment.