Skip to content
This repository was archived by the owner on Apr 9, 2019. It is now read-only.

Commit 5cd2caf

Browse files
author
Matt Hinz
committed
Add failing test for componentWillUnmount
1 parent 3ec421a commit 5cd2caf

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

spec/navigation-controller.spec.jsx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,24 @@ describe('NavigationController', () => {
7676
expect(controller.__springSystem).to.be.an.instanceof(rebound.SpringSystem);
7777
});
7878
});
79+
describe('#componentWillUnmount', () => {
80+
let spring;
81+
beforeEach(() => {
82+
controller = new NavigationController({ views: views });
83+
controller.componentWillMount();
84+
spring = controller.__spring;
85+
controller.componentWillUnmount();
86+
})
87+
it('cleans up spring system', () => {
88+
expect(controller.__springSystem).to.be.undefined
89+
});
90+
it('cleans up spring', () => {
91+
expect(controller.__spring).to.be.undefined
92+
});
93+
it('removes spring event listeners', () => {
94+
expect(spring.listeners).to.deep.equal([]);
95+
});
96+
});
7997
describe('#componentDidMount', () => {
8098
it('caches the view wrappers', () => {
8199
expect(viewWrapper0).to.be.an.instanceof(HTMLElement);

0 commit comments

Comments
 (0)