Skip to content

Instantly share code, notes, and snippets.

@bzalasky
Created October 12, 2012 21:30
Show Gist options
  • Select an option

  • Save bzalasky/3881635 to your computer and use it in GitHub Desktop.

Select an option

Save bzalasky/3881635 to your computer and use it in GitHub Desktop.
click .icons-close-x
describe("click .icons-close-x", function () {
backboneHistorySpy();
beforeEach( function () {
this.closeModalSpy = sinon.spy(StippleApp.Views.PhotoDetailHeader, 'closeModal');
this.view = new StippleApp.Views.PhotoDetailHeader({ model: this.model, modal: true, activeTab: 'engagement' });
this.view.render();
this.view.$(".icons-close-x").click();
});
afterEach( function () {
this.closeModalSpy.restore();
});
it("closes the modal", function () {
expect(this.closeModalSpy).toHaveBeenCalled();
});
// it("calls the goBack helper", function () {
// expect(this.goBackSpy).toHaveBeenCalledOnce();
// });
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment