2017-03-13 23:44:52 -04:00
|
|
|
import { acceptance, logIn } from "helpers/qunit-helpers";
|
2016-12-13 02:15:20 -05:00
|
|
|
|
2017-03-13 23:44:52 -04:00
|
|
|
acceptance("Editing Group");
|
2016-12-13 02:15:20 -05:00
|
|
|
|
|
|
|
test("Editing group", () => {
|
2017-03-13 23:44:52 -04:00
|
|
|
logIn();
|
|
|
|
Discourse.reset();
|
|
|
|
|
2016-12-13 02:15:20 -05:00
|
|
|
visit("/groups/discourse/edit");
|
|
|
|
|
|
|
|
andThen(() => {
|
|
|
|
ok(find('.group-flair-inputs').length === 1, 'it should display avatar flair inputs');
|
|
|
|
ok(find('.group-edit-bio').length === 1, 'it should display group bio input');
|
2016-12-13 03:16:26 -05:00
|
|
|
ok(find('.group-edit-full-name').length === 1, 'it should display group full name input');
|
2016-12-13 02:15:20 -05:00
|
|
|
ok(find('.group-edit-public').length === 1, 'it should display group public input');
|
|
|
|
ok(find('.group-edit-allow-membership-requests').length === 1, 'it should display group allow_membership_requets input');
|
|
|
|
ok(find('.group-members-input .item').length === 7, 'it should display group members');
|
|
|
|
ok(find('.group-members-input-selector').length === 1, 'it should display input to add group members');
|
|
|
|
ok(find('.group-members-input-selector .add[disabled]').length === 1, 'add members button should be disabled');
|
|
|
|
});
|
|
|
|
|
|
|
|
andThen(() => {
|
2017-01-06 03:00:29 -05:00
|
|
|
ok(find('.group-edit-allow-membership-requests[disabled]').length === 1, 'it should disable group allow_membership_request input');
|
2016-12-13 02:15:20 -05:00
|
|
|
});
|
|
|
|
|
|
|
|
click('.group-edit-public');
|
|
|
|
click('.group-edit-allow-membership-requests');
|
|
|
|
|
|
|
|
andThen(() => {
|
|
|
|
ok(find('.group-edit-public[disabled]').length === 1, 'it should disable group public input');
|
|
|
|
});
|
|
|
|
});
|
2017-03-13 23:44:52 -04:00
|
|
|
|
|
|
|
test("Editing group as an anonymous user", () => {
|
|
|
|
visit("/groups/discourse/edit");
|
|
|
|
|
|
|
|
andThen(() => {
|
|
|
|
ok(count('.group-members tr') > 0, "it should redirect to members page for an anonymous user");
|
|
|
|
});
|
2017-03-13 23:47:35 -04:00
|
|
|
});
|