Skip to content

Commit

Permalink
Fix IE9 compatibility bug while re-initializing domEntryPoint
Browse files Browse the repository at this point in the history
  • Loading branch information
reneviering committed Dec 5, 2016
1 parent 4eef6f1 commit f3700fb
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 4 deletions.
23 changes: 23 additions & 0 deletions __tests__/router.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,4 +216,27 @@ describe('router', () => {
});
});
});

describe('with IE9', () => {
test('no error is thrown, because of the domNode.remove()', () => {
const domEntryPointMock = {
parentElement: {
insertBefore: () => {}
},
cloneNode: () => domEntryPointMock,
removeNode: jest.fn(),
remove: undefined
};

const init = () => {
const router = createRouter(domEntryPointMock);
router
.addRoute('', () => {});
simulateHashChange('');
expect(domEntryPointMock.removeNode.mock.calls.length).toEqual(1);
};
expect(init).not.toThrow();

});
});
});
8 changes: 7 additions & 1 deletion dist/vanilla-ui-router.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit f3700fb

Please sign in to comment.