marionette

Expected a spy, but got Function

本秂侑毒 提交于 2019-11-27 07:34:06
问题 I am trying to implement a test (1) for this module (2). My purpose is to check if the collection is fetched when a particular event is triggered. As you can see from my comment in (2) I get the message Error: Expected a spy, but got Function. The module works but the test fails. any ideas? (1) // jasmine test module describe('When onGivePoints is fired', function () { beforeEach(function () { spyOn(this.view.collection, 'restartPolling').andCallThrough(); app.vent.trigger('onGivePoints'); })

Bubbling events in nested Backbone (Marionette) Models / Collections

只谈情不闲聊 提交于 2019-11-26 23:39:59
问题 We have a large Marionette App, that uses Backbone.trackit to monitor unsaved changes in our Models. We now have some nested models, in fact we have a Model, with a Collection of Models, that contain a Collection of Models. trackit doesn't support the top level model being marked as 'dirty' when the child models change - due to backbone not bubbling these change events. I know we could manually monitor these change events, but Im looking for a generic solution. Has anyone had any experience