Close modals at the end of each jasmine spec

closes #7246
This commit is contained in:
Steffen van Bergerem 2016-12-09 20:28:52 +01:00 committed by Benjamin Neff
parent 95ddae86c7
commit fb06d03f49
3 changed files with 6 additions and 2 deletions

View file

@ -6,6 +6,7 @@
## Bug fixes
* Fix background color of year on notifications page with dark theme [#7263](https://github.com/diaspora/diaspora/pull/7263)
* Fix jasmine tests in firefox [#7246](https://github.com/diaspora/diaspora/pull/7246)
## Features
* Add links to the aspects and followed tags pages on mobile [#7265](https://github.com/diaspora/diaspora/pull/7265)

View file

@ -61,7 +61,7 @@ describe("app.views.ProfileHeader", function() {
describe("showMessageModal", function() {
beforeEach(function() {
spec.content().append("<div id='conversationModal'/>");
spec.content().append("<div id='conversationModal' class='modal fade'><div class='modal-body'></div></div>");
});
it("calls app.helpers.showModal", function() {
@ -78,8 +78,8 @@ describe("app.views.ProfileHeader", function() {
];
spyOn(app.views.ConversationsForm.prototype, "initialize");
spyOn($.fn, "load").and.callFake(function(url, callback) { callback(); });
this.view.showMessageModal();
$("#conversationModal").trigger("modal:loaded");
expect(app.views.ConversationsForm.prototype.initialize)
.toHaveBeenCalledWith({prefill: gon.conversationPrefill});
});

View file

@ -78,8 +78,11 @@ afterEach(function() {
jasmine.clock().uninstall();
jasmine.Ajax.uninstall();
$(".modal").removeClass("fade").modal("hide");
$("#jasmine_content").empty();
expect(spec.loadFixtureCount).toBeLessThan(2);
expect($(".modal-backdrop").length).toBe(0);
$(".modal-backdrop").remove();
spec.loadFixtureCount = 0;
});