UX: Display button to message group on group page.

https://meta.discourse.org/t/make-it-easier-to-send-a-message-to-groups/65065
This commit is contained in:
Guo Xiang Tan
2017-07-27 17:51:25 +09:00
parent 9c93a20cf1
commit 75374c76b3
7 changed files with 72 additions and 10 deletions

View File

@@ -42,12 +42,13 @@ QUnit.test("Browsing Groups", assert => {
});
});
QUnit.test("Viewing Group", assert => {
QUnit.test("Anonymous Viewing Group", assert => {
visit("/groups/discourse");
andThen(() => {
assert.ok(count('.avatar-flair .fa-adjust') === 1, "it displays the group's avatar flair");
assert.ok(count('.group-members tr') > 0, "it lists group members");
assert.ok(count('.group-message-button') === 0, 'it does not show group message button');
});
click(".nav-pills li a[title='Activity']");
@@ -80,6 +81,20 @@ QUnit.test("Viewing Group", assert => {
});
});
QUnit.test("User Viewing Group", assert => {
logIn();
Discourse.reset();
visit("/groups/discourse");
click('.group-message-button');
andThen(() => {
assert.ok(count('#reply-control') === 1, 'it opens the composer');
assert.equal(find('.ac-wrap .item').text(), 'discourse', 'it prefills the group name');
});
});
QUnit.test("Admin Viewing Group", assert => {
logIn();
Discourse.reset();
@@ -102,4 +117,4 @@ QUnit.test("Admin Viewing Group", assert => {
'it should show messages tab if user is admin'
);
});
});
});

View File

@@ -6,11 +6,12 @@ export default {
"name":"discourse",
"full_name":"Awesome Team",
"user_count":8,
"alias_level":0,
"alias_level":99,
"visible":true,
"public":true,
"flair_url": 'fa-adjust',
"is_group_owner":true
"is_group_owner":true,
"mentionable":true
}
},
"/groups/discourse/counts.json":{