Merge branch 'next-minor' into develop

This commit is contained in:
Dennis Schubert 2019-01-13 02:17:22 +01:00
commit 97805e6602
No known key found for this signature in database
GPG key ID: 5A0304BEA7966D7E
3 changed files with 10 additions and 2 deletions

View file

@ -17,6 +17,7 @@
## Refactor
## Bug fixes
* Fix incorrect post sorting on tag streams and tag searches for tags containing the word "activity" [#7422](https://github.com/diaspora/diaspora/issues/7422)
## Features

View file

@ -69,7 +69,7 @@ app.models.Stream = Backbone.Collection.extend({
},
sortOrder : function() {
return /activity/.test(this.basePath()) ? "interactedAt" : "createdAt";
return /^\/activity/.test(this.basePath()) ? "interactedAt" : "createdAt";
},
/* This function is for adding a large number of posts one by one.

View file

@ -27,7 +27,7 @@ describe("app.models.Stream", function() {
});
it("returns a comparator for posts that compares interacted_at and ids for the activity stream", function() {
spyOn(stream, "basePath").and.returnValue("activity");
spyOn(stream, "basePath").and.returnValue("/activity");
this.options = stream.collectionOptions();
expect(this.options.comparator(this.post1, this.post2)).toBe(1);
expect(this.options.comparator(this.post2, this.post1)).toBe(-1);
@ -37,6 +37,13 @@ describe("app.models.Stream", function() {
expect(this.options.comparator(this.post4, this.post1)).toBe(1);
expect(this.options.comparator(this.post1, this.post1)).toBe(0);
});
it("returns a comparator for posts that compares created_at and ids for tags including 'activity'", function() {
spyOn(stream, "basePath").and.returnValue("/tags/foo-activity-bar");
this.options = stream.collectionOptions();
expect(this.options.comparator(this.post2, this.post3)).toBe(1);
expect(this.options.comparator(this.post3, this.post2)).toBe(-1);
});
});
describe("#_fetchOpts", function() {