Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Blog - Testing Marionette.js Behaviors - behavior test factory
function addOnClickTests ( context ) {
let model, view;
beforeEach( () => {
model = new context.ModelClass();
view = new context.ViewClass( { model: model } );
} );
it( "should increase the model size by 1 when we click on the view", () => {
model.set( "size", 1 );
view.$el.trigger( "click" );
expect( model.get( "size" ) ).toBe( 2 );
} );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.