FIX: Groups list does not refresh when query changes. (#6481)
This commit is contained in:
parent
1b0fbc4d30
commit
ded5ff90aa
|
@ -11,8 +11,6 @@ export default Discourse.Route.extend({
|
|||
username: { refreshModel: true }
|
||||
},
|
||||
|
||||
refreshQueryWithoutTransition: true,
|
||||
|
||||
model(params) {
|
||||
this._params = params;
|
||||
return this.store.findAll("group", params);
|
||||
|
|
|
@ -3,6 +3,10 @@ import { acceptance } from "helpers/qunit-helpers";
|
|||
acceptance("Groups");
|
||||
|
||||
QUnit.test("Browsing Groups", async assert => {
|
||||
await visit("/groups?username=eviltrout");
|
||||
|
||||
assert.equal(count(".groups-table-row"), 1, "it displays user's groups");
|
||||
|
||||
await visit("/groups");
|
||||
|
||||
assert.equal(count(".groups-table-row"), 2, "it displays visible groups");
|
||||
|
|
|
@ -50,5 +50,34 @@ export default {
|
|||
extras: { group_user_ids: [] },
|
||||
total_rows_groups: 2,
|
||||
load_more_groups: "/groups?page=1"
|
||||
},
|
||||
"/groups.json?username=eviltrout": {
|
||||
groups: [
|
||||
{
|
||||
id: 41,
|
||||
automatic: false,
|
||||
name: "discourse",
|
||||
user_count: 0,
|
||||
alias_level: 0,
|
||||
visible: true,
|
||||
automatic_membership_email_domains: "",
|
||||
automatic_membership_retroactive: false,
|
||||
primary_group: false,
|
||||
title: null,
|
||||
grant_trust_level: null,
|
||||
has_messages: false,
|
||||
flair_url: null,
|
||||
flair_bg_color: null,
|
||||
flair_color: null,
|
||||
bio_raw: "",
|
||||
bio_cooked: null,
|
||||
public_admission: true,
|
||||
allow_membership_requests: false,
|
||||
full_name: "Awesome Team"
|
||||
}
|
||||
],
|
||||
extras: { group_user_ids: [] },
|
||||
total_rows_groups: 1,
|
||||
load_more_groups: "/groups?page=1"
|
||||
}
|
||||
};
|
||||
|
|
|
@ -350,6 +350,10 @@ export default function() {
|
|||
return response(200, fixturesByUrl["/groups.json"]);
|
||||
});
|
||||
|
||||
this.get("/groups.json", () => {
|
||||
return response(200, fixturesByUrl["/groups.json?username=eviltrout"]);
|
||||
});
|
||||
|
||||
this.get("groups/search.json", () => {
|
||||
return response(200, []);
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue