diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-05 19:20:45 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-05 19:20:45 +0300 |
commit | d298fad0c0564454271cba11e6f20c19681534ac (patch) | |
tree | 0a19d07d8b3bdd2574617305c300e404f2ace581 /spec/frontend/groups/members/utils_spec.js | |
parent | c9f9eec79cab801a50db698f682aacffbedf07f7 (diff) |
Add latest changes from gitlab-org/gitlab@13-9-stable-eev13.9.0-rc41
Diffstat (limited to 'spec/frontend/groups/members/utils_spec.js')
-rw-r--r-- | spec/frontend/groups/members/utils_spec.js | 45 |
1 files changed, 3 insertions, 42 deletions
diff --git a/spec/frontend/groups/members/utils_spec.js b/spec/frontend/groups/members/utils_spec.js index 68945174e9d..0912e66e3e8 100644 --- a/spec/frontend/groups/members/utils_spec.js +++ b/spec/frontend/groups/members/utils_spec.js @@ -1,53 +1,14 @@ -import { membersJsonString, membersParsed } from './mock_data'; -import { - parseDataAttributes, - memberRequestFormatter, - groupLinkRequestFormatter, -} from '~/groups/members/utils'; +import { groupMemberRequestFormatter } from '~/groups/members/utils'; describe('group member utils', () => { - describe('parseDataAttributes', () => { - let el; - - beforeEach(() => { - el = document.createElement('div'); - el.setAttribute('data-members', membersJsonString); - el.setAttribute('data-group-id', '234'); - el.setAttribute('data-can-manage-members', 'true'); - }); - - afterEach(() => { - el = null; - }); - - it('correctly parses the data attributes', () => { - expect(parseDataAttributes(el)).toEqual({ - members: membersParsed, - sourceId: 234, - canManageMembers: true, - }); - }); - }); - - describe('memberRequestFormatter', () => { + describe('groupMemberRequestFormatter', () => { it('returns expected format', () => { expect( - memberRequestFormatter({ + groupMemberRequestFormatter({ accessLevel: 50, expires_at: '2020-10-16', }), ).toEqual({ group_member: { access_level: 50, expires_at: '2020-10-16' } }); }); }); - - describe('groupLinkRequestFormatter', () => { - it('returns expected format', () => { - expect( - groupLinkRequestFormatter({ - accessLevel: 50, - expires_at: '2020-10-16', - }), - ).toEqual({ group_link: { group_access: 50, expires_at: '2020-10-16' } }); - }); - }); }); |