File size: 918 Bytes
1e92f2d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
import data from '../../shared/testing/data';
const community = data.communities[0];
const members = data.usersCommunities
.filter(
({ communityId, isMember }) => community.id === communityId && isMember
)
.map(({ userId }) => data.users.find(({ id }) => id === userId));
const { userId: ownerId } = data.usersCommunities.find(
({ communityId, isOwner }) => communityId === community.id && isOwner
);
const channels = data.channels.filter(
({ communityId }) => community.id === communityId
);
describe('Community settings members tab', () => {
beforeEach(() => {
cy.auth(ownerId);
});
it('should have a list of the members', () => {
cy.visit(`/${community.slug}/settings`);
cy
.get(`[href="/${community.slug}/settings/members"]`)
.should('be.visible')
.click();
members.forEach(member => {
cy.contains(member.name).should('be.visible');
});
});
});
|