@@ -185,4 +185,25 @@ test('Should pass props, ref and firebase to mapFirebaseToProps', assert => {
185185 assert . end ( )
186186} )
187187
188- test ( 'Should update subscriptions when props change' )
188+ test ( 'Should update subscriptions when props change' , assert => {
189+ const mapFirebaseToProps = props => ( { foo : props . foo , bar : props . bar } )
190+
191+ const firebaseApp = createMockApp ( )
192+ const initial = renderStub ( mapFirebaseToProps , firebaseApp , { foo : 'foo' } )
193+ assert . equal ( initial . props . foo , 'foo value' )
194+ assert . equal ( initial . props . bar , undefined )
195+
196+ const added = renderStub ( mapFirebaseToProps , firebaseApp , { foo : 'foo' , bar : 'bar' } )
197+ assert . equal ( added . props . foo , 'foo value' )
198+ assert . equal ( added . props . bar , 'bar value' )
199+
200+ const changed = renderStub ( mapFirebaseToProps , firebaseApp , { foo : 'foo' , bar : 'baz' } )
201+ assert . equal ( changed . props . foo , 'foo value' )
202+ assert . equal ( changed . props . bar , 'baz value' )
203+
204+ const removed = renderStub ( mapFirebaseToProps , firebaseApp , { bar : 'baz' } )
205+ assert . equal ( removed . props . foo , undefined )
206+ assert . equal ( removed . props . bar , 'baz value' )
207+
208+ assert . end ( )
209+ } )
0 commit comments