mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
UX: Tweaks to group pages.
This commit is contained in:
@@ -11,8 +11,8 @@ acceptance("Group logs", {
|
||||
];
|
||||
};
|
||||
|
||||
server.get('/groups/snorlax.json', () => { // eslint-disable-line no-undef
|
||||
return response({"basic_group":{"id":41,"automatic":false,"name":"snorlax","user_count":1,"alias_level":0,"visible":true,"automatic_membership_email_domains":"","automatic_membership_retroactive":false,"primary_group":true,"title":"Team Snorlax","grant_trust_level":null,"incoming_email":null,"has_messages":false,"flair_url":"","flair_bg_color":"","flair_color":"","bio_raw":"","bio_cooked":null,"public":true,"is_group_user":true,"is_group_owner":true}});
|
||||
server.get('/groups/snorlax', () => { // eslint-disable-line no-undef
|
||||
return response({"group":{"id":41,"automatic":false,"name":"snorlax","user_count":1,"alias_level":0,"visible":true,"automatic_membership_email_domains":"","automatic_membership_retroactive":false,"primary_group":true,"title":"Team Snorlax","grant_trust_level":null,"incoming_email":null,"has_messages":false,"flair_url":"","flair_bg_color":"","flair_color":"","bio_raw":"","bio_cooked":null,"public":true,"is_group_user":true,"is_group_owner":true}});
|
||||
});
|
||||
|
||||
// Workaround while awaiting https://github.com/tildeio/route-recognizer/issues/53
|
||||
|
||||
@@ -45,6 +45,15 @@ QUnit.test("Anonymous Viewing Group", assert => {
|
||||
assert.ok(find(".nav-pills li a[title='Logs']").length === 0, 'it should not show Logs tab if user is not admin');
|
||||
assert.ok(count('.group-post') > 0, "it lists stream items");
|
||||
});
|
||||
|
||||
selectKit('.group-dropdown').expand();
|
||||
|
||||
andThen(() => {
|
||||
assert.equal(
|
||||
find('.select-kit-row').text().trim(), 'discourse',
|
||||
'it displays the right row'
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
QUnit.test("User Viewing Group", assert => {
|
||||
|
||||
@@ -19,7 +19,7 @@ QUnit.test("Creating a new group", assert => {
|
||||
|
||||
visit("/groups");
|
||||
|
||||
selectKit('.groups-admin-dropdown').expand().selectRowByValue("new");
|
||||
click(".groups-header-new");
|
||||
fillIn("input[name='name']", '1');
|
||||
|
||||
andThen(() => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
export default {
|
||||
"/groups/discourse.json":{
|
||||
"basic_group":{
|
||||
"/groups/discourse":{
|
||||
"group":{
|
||||
"id":47,
|
||||
"automatic":false,
|
||||
"name":"discourse",
|
||||
@@ -14,6 +14,9 @@ export default {
|
||||
"is_group_owner":true,
|
||||
"mentionable":true,
|
||||
"messageable":true
|
||||
},
|
||||
"extras": {
|
||||
"visible_group_names": ["discourse"]
|
||||
}
|
||||
},
|
||||
"/topics/groups/discourse.json":{
|
||||
|
||||
@@ -53,7 +53,7 @@ export default function(helpers) {
|
||||
this.get('/widgets/:widget_id', function(request) {
|
||||
const w = _widgets.findBy('id', parseInt(request.params.widget_id));
|
||||
if (w) {
|
||||
return response({widget: w});
|
||||
return response({ widget: w, extras: { hello: 'world' }});
|
||||
} else {
|
||||
return response(404);
|
||||
}
|
||||
|
||||
@@ -49,14 +49,17 @@ QUnit.test('createRecord with a record as attributes returns that record from th
|
||||
|
||||
QUnit.test('find', assert => {
|
||||
const store = createStore();
|
||||
|
||||
return store.find('widget', 123).then(function(w) {
|
||||
assert.equal(w.get('name'), 'Trout Lure');
|
||||
assert.equal(w.get('id'), 123);
|
||||
assert.ok(!w.get('isNew'), 'found records are not new');
|
||||
assert.equal(w.get('extras.hello'), 'world', "extra attributes are set");
|
||||
|
||||
// A second find by id returns the same object
|
||||
store.find('widget', 123).then(function(w2) {
|
||||
assert.equal(w, w2);
|
||||
assert.equal(w.get('extras.hello'), 'world', "extra attributes are set");
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user