Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
99f88012
Commit
99f88012
authored
Jul 23, 2021
by
Sheldon Led
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use `it.each` in the new test as per MR suggestion
parent
d993263a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
18 deletions
+22
-18
ee/spec/frontend/billings/seat_usage/components/subscription_seats_spec.js
...billings/seat_usage/components/subscription_seats_spec.js
+22
-18
No files found.
ee/spec/frontend/billings/seat_usage/components/subscription_seats_spec.js
View file @
99f88012
...
...
@@ -176,27 +176,31 @@ describe('Subscription Seats', () => {
});
});
describe
(
'
member
badges
'
,
()
=>
{
it
(
'
shows the correct
badge based on membership_type
'
,
()
=>
{
describe
(
'
member
s avatar
'
,
()
=>
{
it
(
'
shows the correct
avatarLinks length
'
,
()
=>
{
const
avatarLinks
=
findTable
().
findAllComponents
(
GlAvatarLink
);
expect
(
avatarLinks
.
length
).
toBe
(
4
);
avatarLinks
.
wrappers
.
forEach
((
avatarLinkWrapper
)
=>
{
const
currentMember
=
mockTableItems
.
find
(
(
item
)
=>
item
.
user
.
name
===
avatarLinkWrapper
.
attributes
().
alt
,
);
const
currentMembershipType
=
currentMember
.
user
.
membership_type
;
const
membershipTypesWithBadge
=
[
'
group_invite
'
,
'
project_invite
'
];
if
(
membershipTypesWithBadge
.
includes
(
currentMembershipType
))
{
const
badgeText
=
(
currentMembershipType
.
charAt
(
0
).
toUpperCase
()
+
currentMembershipType
.
slice
(
1
)
).
replace
(
'
_
'
,
'
'
);
expect
(
avatarLinkWrapper
.
find
(
GlBadge
).
text
()).
toBe
(
badgeText
);
}
});
});
it
.
each
([
'
group_invite
'
,
'
project_invite
'
])(
'
shows the correct badge for membership_type %s
'
,
(
membershipType
)
=>
{
const
avatarLinks
=
findTable
().
findAllComponents
(
GlAvatarLink
);
const
badgeText
=
(
membershipType
.
charAt
(
0
).
toUpperCase
()
+
membershipType
.
slice
(
1
)
).
replace
(
'
_
'
,
'
'
);
avatarLinks
.
wrappers
.
forEach
((
avatarLinkWrapper
)
=>
{
const
currentMember
=
mockTableItems
.
find
(
(
item
)
=>
item
.
user
.
name
===
avatarLinkWrapper
.
attributes
().
alt
,
);
if
(
membershipType
===
currentMember
.
user
.
membership_type
)
{
expect
(
avatarLinkWrapper
.
find
(
GlBadge
).
text
()).
toBe
(
badgeText
);
}
});
},
);
});
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment