mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
UX: Consolidation group manangement into a single tab.
This commit is contained in:
@@ -1,61 +0,0 @@
|
||||
import { acceptance, logIn } from "helpers/qunit-helpers";
|
||||
|
||||
acceptance("Editing Group");
|
||||
|
||||
QUnit.test("Editing group", assert => {
|
||||
logIn();
|
||||
Discourse.reset();
|
||||
|
||||
visit("/groups/discourse/edit");
|
||||
|
||||
andThen(() => {
|
||||
assert.ok(find('.group-flair-inputs').length === 1, 'it should display avatar flair inputs');
|
||||
assert.ok(find('.group-edit-bio').length === 1, 'it should display group bio input');
|
||||
assert.ok(find('.group-edit-full-name').length === 1, 'it should display group full name input');
|
||||
|
||||
assert.ok(
|
||||
find('.group-edit-public-admission').length === 1,
|
||||
'it should display group public admission input'
|
||||
);
|
||||
|
||||
assert.ok(
|
||||
find('.group-edit-public-exit').length === 1,
|
||||
'it should display group public exit input'
|
||||
);
|
||||
|
||||
assert.ok(find('.group-edit-allow-membership-requests').length === 1, 'it should display group allow_membership_requets input');
|
||||
|
||||
assert.ok(
|
||||
find('.group-edit-allow-membership-requests[disabled]').length === 1,
|
||||
'it should disable group allow_membership_request input'
|
||||
);
|
||||
});
|
||||
|
||||
click('.group-edit-public-admission');
|
||||
click('.group-edit-allow-membership-requests');
|
||||
|
||||
andThen(() => {
|
||||
assert.ok(
|
||||
find('.group-edit-public-admission[disabled]').length === 1,
|
||||
'it should disable group public admission input'
|
||||
);
|
||||
|
||||
assert.ok(
|
||||
find('.group-edit-public-exit[disabled]').length === 0,
|
||||
'it should not disable group public exit input'
|
||||
);
|
||||
|
||||
assert.equal(
|
||||
find('.group-edit-membership-request-template').length, 1,
|
||||
'it should display the membership request template field'
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
QUnit.test("Editing group as an anonymous user", assert => {
|
||||
visit("/groups/discourse/edit");
|
||||
|
||||
andThen(() => {
|
||||
assert.ok(count('.group-members tr') > 0, "it should redirect to members page for an anonymous user");
|
||||
});
|
||||
});
|
||||
@@ -9,11 +9,6 @@ QUnit.test("Viewing Members as anon user", assert => {
|
||||
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-navigation-dropdown') === 0,
|
||||
'it should not display the group navigation dropdown menu'
|
||||
);
|
||||
|
||||
assert.ok(
|
||||
count('.group-member-dropdown') === 0,
|
||||
'it does not allow anon user to manage group members'
|
||||
@@ -34,11 +29,6 @@ QUnit.test("Viewing Members as an admin user", assert => {
|
||||
visit("/groups/discourse");
|
||||
|
||||
andThen(() => {
|
||||
assert.ok(
|
||||
count('.group-navigation-dropdown') === 1,
|
||||
'it should display the group navigation dropdown menu'
|
||||
);
|
||||
|
||||
assert.ok(
|
||||
count('.group-member-dropdown') > 0,
|
||||
'it allows admin user to manage group members'
|
||||
@@ -50,23 +40,4 @@ QUnit.test("Viewing Members as an admin user", assert => {
|
||||
'it should display the right filter placehodler'
|
||||
);
|
||||
});
|
||||
|
||||
selectKit('.group-navigation-dropdown').expand().selectRowByValue('manageMembership');
|
||||
|
||||
andThen(() => {
|
||||
assert.ok(
|
||||
count('.group-membership') === 1,
|
||||
'it should display the right modal'
|
||||
);
|
||||
|
||||
assert.ok(
|
||||
count('#group-membership-user-selector') === 1,
|
||||
'it should display the user selector'
|
||||
);
|
||||
|
||||
assert.ok(
|
||||
count(".group-membership-make-owner input[type='checkbox']") === 1,
|
||||
'it should display the input to set users as owners'
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { acceptance } from "helpers/qunit-helpers";
|
||||
|
||||
acceptance("Group Logs", {
|
||||
acceptance("Group logs", {
|
||||
loggedIn: true,
|
||||
beforeEach() {
|
||||
const response = object => {
|
||||
@@ -27,14 +27,14 @@ acceptance("Group Logs", {
|
||||
});
|
||||
|
||||
QUnit.test("Browsing group logs", assert => {
|
||||
visit("/groups/snorlax/logs");
|
||||
visit("/groups/snorlax/manage/logs");
|
||||
|
||||
andThen(() => {
|
||||
assert.ok(find('tr.group-logs-row').length === 2, 'it should display the right number of logs');
|
||||
click(find(".group-logs-row button")[0]);
|
||||
assert.ok(find('tr.group-manage-logs-row').length === 2, 'it should display the right number of logs');
|
||||
click(find(".group-manage-logs-row button")[0]);
|
||||
});
|
||||
|
||||
andThen(() => {
|
||||
assert.ok(find('tr.group-logs-row').length === 1, 'it should display the right number of logs');
|
||||
assert.ok(find('tr.group-manage-logs-row').length === 1, 'it should display the right number of logs');
|
||||
});
|
||||
});
|
||||
});
|
||||
62
test/javascripts/acceptance/group-manage-profile-test.js.es6
Normal file
62
test/javascripts/acceptance/group-manage-profile-test.js.es6
Normal file
@@ -0,0 +1,62 @@
|
||||
import { acceptance, logIn } from "helpers/qunit-helpers";
|
||||
|
||||
acceptance("Managing Group Profile");
|
||||
|
||||
QUnit.test("Editing group", assert => {
|
||||
logIn();
|
||||
Discourse.reset();
|
||||
|
||||
visit("/groups/discourse/manage/profile");
|
||||
|
||||
andThen(() => {
|
||||
assert.ok(find('.group-flair-inputs').length === 1, 'it should display avatar flair inputs');
|
||||
assert.ok(find('.group-manage-bio').length === 1, 'it should display group bio input');
|
||||
assert.ok(find('.group-manage-name').length === 1, 'it should display group name input');
|
||||
assert.ok(find('.group-manage-full-name').length === 1, 'it should display group full name input');
|
||||
|
||||
assert.ok(
|
||||
find('.group-manage-public-admission').length === 1,
|
||||
'it should display group public admission input'
|
||||
);
|
||||
|
||||
assert.ok(
|
||||
find('.group-manage-public-exit').length === 1,
|
||||
'it should display group public exit input'
|
||||
);
|
||||
|
||||
assert.ok(find('.group-manage-allow-membership-requests').length === 1, 'it should display group allow_membership_requets input');
|
||||
|
||||
assert.ok(
|
||||
find('.group-manage-allow-membership-requests[disabled]').length === 1,
|
||||
'it should disable group allow_membership_request input'
|
||||
);
|
||||
});
|
||||
|
||||
click('.group-manage-public-admission');
|
||||
click('.group-manage-allow-membership-requests');
|
||||
|
||||
andThen(() => {
|
||||
assert.ok(
|
||||
find('.group-manage-public-admission[disabled]').length === 1,
|
||||
'it should disable group public admission input'
|
||||
);
|
||||
|
||||
assert.ok(
|
||||
find('.group-manage-public-exit[disabled]').length === 0,
|
||||
'it should not disable group public exit input'
|
||||
);
|
||||
|
||||
assert.equal(
|
||||
find('.group-manage-membership-request-template').length, 1,
|
||||
'it should display the membership request template field'
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
QUnit.test("Editing group as an anonymous user", assert => {
|
||||
visit("/groups/discourse/manage/profile");
|
||||
|
||||
andThen(() => {
|
||||
assert.ok(count('.group-members tr') > 0, "it should redirect to members page for an anonymous user");
|
||||
});
|
||||
});
|
||||
@@ -193,8 +193,11 @@ QUnit.test("Admin Viewing Group", assert => {
|
||||
visit("/groups/discourse");
|
||||
|
||||
andThen(() => {
|
||||
assert.ok(find(".nav-pills li a[title='Edit Group']").length === 1, 'it should show edit group tab if user is admin');
|
||||
assert.ok(find(".nav-pills li a[title='Logs']").length === 1, 'it should show Logs tab if user is admin');
|
||||
assert.ok(
|
||||
find(".nav-pills li a[title='Manage']").length === 1,
|
||||
'it should show manage group tab if user is admin'
|
||||
);
|
||||
|
||||
assert.equal(count('.group-message-button'), 1, 'it displays show group message button');
|
||||
assert.equal(find('.group-info-name').text(), 'Awesome Team', 'it should display the group name');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user