parent
8e345c0335
commit
b645541d52
3 changed files with 37 additions and 0 deletions
|
|
@ -15,6 +15,7 @@
|
||||||
* Only reload profile header when changing aspect memberships [#7183](https://github.com/diaspora/diaspora/pull/7183)
|
* Only reload profile header when changing aspect memberships [#7183](https://github.com/diaspora/diaspora/pull/7183)
|
||||||
* Fix visiblity on invitation modal when opening it from the stream [#7191](https://github.com/diaspora/diaspora/pull/7191)
|
* Fix visiblity on invitation modal when opening it from the stream [#7191](https://github.com/diaspora/diaspora/pull/7191)
|
||||||
* Add avatar fallback on tags page [#7198](https://github.com/diaspora/diaspora/pull/7198)
|
* Add avatar fallback on tags page [#7198](https://github.com/diaspora/diaspora/pull/7198)
|
||||||
|
* Update notifications when changing the stream [#7199](https://github.com/diaspora/diaspora/pull/7199)
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
* Show spinner when loading comments in the stream [#7170](https://github.com/diaspora/diaspora/pull/7170)
|
* Show spinner when loading comments in the stream [#7170](https://github.com/diaspora/diaspora/pull/7170)
|
||||||
|
|
|
||||||
|
|
@ -115,6 +115,7 @@ var app = {
|
||||||
// so we use Backbone.history.navigate instead.
|
// so we use Backbone.history.navigate instead.
|
||||||
var change = Backbone.history.navigate(link.attr("href").substring(1) ,true);
|
var change = Backbone.history.navigate(link.attr("href").substring(1) ,true);
|
||||||
if(change === undefined) { Backbone.history.loadUrl(link.attr("href").substring(1)); }
|
if(change === undefined) { Backbone.history.loadUrl(link.attr("href").substring(1)); }
|
||||||
|
app.notificationsCollection.fetch();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -96,4 +96,39 @@ describe("app", function() {
|
||||||
expect(app._changeLocation).toHaveBeenCalledWith("/users/sign_in");
|
expect(app._changeLocation).toHaveBeenCalledWith("/users/sign_in");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe("setupBackboneLinks", function() {
|
||||||
|
it("calls Backbone.history.start", function() {
|
||||||
|
spyOn(Backbone.history, "start");
|
||||||
|
app.setupBackboneLinks();
|
||||||
|
expect(Backbone.history.start).toHaveBeenCalledWith({pushState: true});
|
||||||
|
});
|
||||||
|
|
||||||
|
context("when clicking a backbone link", function() {
|
||||||
|
beforeEach(function() {
|
||||||
|
app.stream = {basePath: function() { return "/stream"; }};
|
||||||
|
app.notificationsCollection = {fetch: $.noop};
|
||||||
|
spyOn(Backbone.history, "start");
|
||||||
|
this.link = $("<a href='/backbone-link' rel='backbone'>");
|
||||||
|
spec.content().append(this.link);
|
||||||
|
app.setupBackboneLinks();
|
||||||
|
});
|
||||||
|
|
||||||
|
afterEach(function() {
|
||||||
|
app.stream = undefined;
|
||||||
|
});
|
||||||
|
|
||||||
|
it("calls Backbone.history.navigate", function() {
|
||||||
|
spyOn(Backbone.history, "navigate");
|
||||||
|
this.link.click();
|
||||||
|
expect(Backbone.history.navigate).toHaveBeenCalledWith("backbone-link", true);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("fetches new notifications", function() {
|
||||||
|
spyOn(app.notificationsCollection, "fetch");
|
||||||
|
this.link.click();
|
||||||
|
expect(app.notificationsCollection.fetch).toHaveBeenCalled();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue