.addMember("foo")
.shouldHaveTotal(2);
page.getMembersByIdx(0).shouldBeNamed("admin", "Administrator").shouldHaveGroups(2);
- page.getMembersByIdx(1).shouldBeNamed("foo", "foo").shouldHaveGroups(0);
+ page.getMembersByIdx(1).shouldBeNamed("foo", "foo").shouldHaveGroups(1);
}
@Test
}
@Test
- @Ignore("To be fixed by SONAR-8992")
public void groups_count_should_be_updated_when_a_member_was_just_added() {
String orgKey = createOrganization();
userRule.createUser("foo", "pwd");
) => getJSON('/api/organizations/search_members', data);
export const addMember = (data: { login: string, organization: string }) =>
- post('/api/organizations/add_member', data);
+ postJSON('/api/organizations/add_member', data).then(r => r.user);
export const removeMember = (data: { login: string, organization: string }) =>
post('/api/organizations/remove_member', data);
export const addOrganizationMember = (key: string, member: Member) =>
(dispatch: Function) => {
- dispatch(membersActions.addMember(key, member));
- return api.addMember({ login: member.login, organization: key }).catch((error: Object) => {
- onFail(dispatch)(error);
- dispatch(membersActions.removeMember(key, member));
- });
+ return api
+ .addMember({ login: member.login, organization: key })
+ .then(user => dispatch(membersActions.addMember(key, user)), onFail(dispatch));
};
export const removeOrganizationMember = (key: string, member: Member) =>