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
529abbf8
Commit
529abbf8
authored
Jan 22, 2021
by
peterhegman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor specs to use shared variable
parent
17dc93d6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
14 deletions
+10
-14
spec/frontend/members/store/mutations_spec.js
spec/frontend/members/store/mutations_spec.js
+10
-14
No files found.
spec/frontend/members/store/mutations_spec.js
View file @
529abbf8
...
...
@@ -44,18 +44,16 @@ describe('Vuex members mutations', () => {
describe
(
'
when error has a message
'
,
()
=>
{
it
(
'
shows error message
'
,
()
=>
{
const
error
=
new
Error
(
'
Request failed with status code 422
'
);
const
message
=
'
User email "john.smith@gmail.com" does not match the allowed domain of example.com
'
;
error
.
response
=
{
data
:
{
message
:
'
User email "john.smith@gmail.com" does not match the allowed domain of example.com
'
,
},
data
:
{
message
},
};
mutations
[
types
.
RECEIVE_MEMBER_ROLE_ERROR
](
state
,
{
error
});
expect
(
state
.
showError
).
toBe
(
true
);
expect
(
state
.
errorMessage
).
toBe
(
'
User email "john.smith@gmail.com" does not match the allowed domain of example.com
'
,
);
expect
(
state
.
errorMessage
).
toBe
(
message
);
});
});
});
...
...
@@ -90,18 +88,16 @@ describe('Vuex members mutations', () => {
describe
(
'
when error has a message
'
,
()
=>
{
it
(
'
shows error message
'
,
()
=>
{
const
error
=
new
Error
(
'
Request failed with status code 422
'
);
const
message
=
'
User email "john.smith@gmail.com" does not match the allowed domain of example.com
'
;
error
.
response
=
{
data
:
{
message
:
'
User email "john.smith@gmail.com" does not match the allowed domain of example.com
'
,
},
data
:
{
message
},
};
mutations
[
types
.
RECEIVE_MEMBER_EXPIRATION_ERROR
](
state
,
{
error
});
expect
(
state
.
showError
).
toBe
(
true
);
expect
(
state
.
errorMessage
).
toBe
(
'
User email "john.smith@gmail.com" does not match the allowed domain of example.com
'
,
);
expect
(
state
.
errorMessage
).
toBe
(
message
);
});
});
});
...
...
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