Skip to content

Commit

Permalink
Fix tests for IE
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Gelsey committed Apr 21, 2017
1 parent 9034d4a commit e3538cb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/react-data-grid/src/__tests__/Focus.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,15 @@ describe('Focus Tests', () => {

describe('with current focus on the body', function() {
it('should receive focus when onscreen', function() {
document.body.focus(); // IE requires this explicitly (otherwise activeElement is null)
expect(document.activeElement).toBe(document.body);
testElement = renderComponent(container);
expect(document.activeElement).toBe(
testElement.find('.react-grid-Cell').first().node
);
});
it('should not receive focus when offscreen', function() {
document.body.focus(); // IE requires this explicitly (otherwise activeElement is null)
expect(document.activeElement).toBe(document.body);
window.scrollTo(0, 2000);
expect(document.activeElement).toBe(document.body);
Expand Down

0 comments on commit e3538cb

Please sign in to comment.