-
Notifications
You must be signed in to change notification settings - Fork 158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CollectionBinder unit tests #209
CollectionBinder unit tests #209
Conversation
Still a ways to go, though.
}); | ||
}); | ||
|
||
describe("Using collection events", function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would remove this section. It doesn't test any behavior expected by a user.
Instead we should test that CollectionBinder adds elements on collection.add, remove on collection.remove, do complex actions on collection.set/reset (that is what you actually do in the other sections below).
Conflicts: spec/SpecRunner.html
Just need to test HTML string templating next.
Using a different style than ElManagerFactory tests which I think is better. Need to refactor ElManagerFactory tests to match and possibly augment the CollectionBinder tests.
@amakhrov I've checked in bare bones for ElManagerFactory and ViewManagerFactory tests. Which do you like better? (ElManagerFactory is more integration level, ViewManagerFactory is more unit level. I'm leaning towards ViewManagerFactory at the moment because then I can rewrite some of the CollectionBinder tests in terms of elManagerFactory/elManager stub invocations, allowing the tests to have the same separation of concerns that the code currently allows for.) @theironcook As I was writing some of these, I was thinking maybe it might be worth (eventually) refactoring ElManagerFactory in terms of ViewManagerFactory? (That is, ElManagerFactory is a ViewManagerFactory with a preconfigured view that just spews out the given HTML or template, in such a way as to maintain the contract and behavior of the current ElManagerFactory.) I feel like it would make testing and reasoning about this a bit easier; and it would also eventually allow for only one elManagerFactory (ViewManagerFactory) and we could just expose factory functions for the preconfigured views. Let me know what you think. |
This pull request is being made to address #208 (lack of unit tests for Backbone.CollectionBinder).
Get involved!
Want to help out? This could get done faster if multiple people chip in :-) Just follow these steps:
https://github.com/platinumazure/Backbone.ModelBinder.git
);platinumazure/Backbone.ModelBinder:collectionbinder-tests
;base fork
to the platinumazure Backbone.ModelBinder and thebase
to "collectionbinder-tests".Current Status
It's going to take some time to get them all done, so I'm going to use this initial comment to provide a running status update as I add commits.
Last updated 2/21/2015 03:38 GMT
Done
To Do
Note: Auto-sort testing has been covered by previously merged pull requests