2016-11-25 15:26:49 +08:00
|
|
|
import { acceptance, logIn } from "helpers/qunit-helpers";
|
|
|
|
|
2015-04-07 02:14:00 +08:00
|
|
|
acceptance("Groups");
|
2015-01-24 00:13:27 +08:00
|
|
|
|
2015-03-19 19:22:56 +08:00
|
|
|
test("Browsing Groups", () => {
|
2015-01-24 00:13:27 +08:00
|
|
|
visit("/groups/discourse");
|
2016-11-29 13:42:47 +08:00
|
|
|
|
2015-03-19 19:22:56 +08:00
|
|
|
andThen(() => {
|
2016-11-29 13:42:47 +08:00
|
|
|
ok(count('.avatar-flair .fa-adjust') === 1, "it displays the group's avatar flair");
|
2016-06-02 21:21:43 +08:00
|
|
|
ok(count('.group-members tr') > 0, "it lists group members");
|
2015-01-24 00:13:27 +08:00
|
|
|
});
|
2015-03-19 19:22:56 +08:00
|
|
|
|
2016-06-02 21:21:43 +08:00
|
|
|
visit("/groups/discourse/posts");
|
2015-03-19 19:22:56 +08:00
|
|
|
andThen(() => {
|
2016-06-02 21:21:43 +08:00
|
|
|
ok(count('.user-stream .item') > 0, "it lists stream items");
|
2015-01-24 00:13:27 +08:00
|
|
|
});
|
2016-04-12 01:16:37 +08:00
|
|
|
|
|
|
|
visit("/groups/discourse/topics");
|
|
|
|
andThen(() => {
|
|
|
|
ok(count('.user-stream .item') > 0, "it lists stream items");
|
|
|
|
});
|
|
|
|
|
|
|
|
visit("/groups/discourse/mentions");
|
|
|
|
andThen(() => {
|
|
|
|
ok(count('.user-stream .item') > 0, "it lists stream items");
|
|
|
|
});
|
|
|
|
|
|
|
|
visit("/groups/discourse/messages");
|
|
|
|
andThen(() => {
|
2016-11-30 16:11:02 +08:00
|
|
|
ok($('.nav-stacked li').length === 4, 'it should not show messages tab');
|
2016-04-12 01:16:37 +08:00
|
|
|
ok(count('.user-stream .item') > 0, "it lists stream items");
|
|
|
|
});
|
2015-01-24 00:13:27 +08:00
|
|
|
});
|
2016-11-25 15:26:49 +08:00
|
|
|
|
2016-11-29 16:25:02 +08:00
|
|
|
test("Admin Browsing Groups", () => {
|
2016-11-25 15:26:49 +08:00
|
|
|
logIn();
|
|
|
|
Discourse.reset();
|
|
|
|
|
|
|
|
visit("/groups/discourse");
|
|
|
|
|
|
|
|
andThen(() => {
|
2016-11-30 16:11:02 +08:00
|
|
|
ok($('.nav-stacked li').length === 5, 'it should show messages tab if user is admin');
|
2016-11-25 15:26:49 +08:00
|
|
|
});
|
2016-11-29 16:25:02 +08:00
|
|
|
|
|
|
|
click('.group-edit-btn');
|
|
|
|
|
|
|
|
andThen(() => {
|
|
|
|
ok(find('.group-flair-inputs').length === 1, 'it should display avatar flair inputs');
|
2016-12-05 16:18:24 +08:00
|
|
|
ok(find('.edit-group-bio').length === 1, 'it should display group bio input');
|
2016-11-29 16:25:02 +08:00
|
|
|
});
|
2016-11-25 15:26:49 +08:00
|
|
|
});
|