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
a61e5877
Commit
a61e5877
authored
Aug 05, 2020
by
Fernando
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement code review suggestions
* Tweak mutations and update unit tests
parent
4075c2e6
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
0 deletions
+6
-0
ee/app/assets/javascripts/security_configuration/modules/configuration/mutations.js
...security_configuration/modules/configuration/mutations.js
+3
-0
ee/spec/frontend/security_configuration/modules/configuration/mutation_spec.js
...rity_configuration/modules/configuration/mutation_spec.js
+3
-0
No files found.
ee/app/assets/javascripts/security_configuration/modules/configuration/mutations.js
View file @
a61e5877
...
...
@@ -6,12 +6,15 @@ export default {
},
[
types
.
REQUEST_SECURITY_CONFIGURATION
](
state
)
{
state
.
isLoading
=
true
;
state
.
errorLoading
=
false
;
},
[
types
.
RECEIVE_SECURITY_CONFIGURATION_SUCCESS
](
state
,
payload
)
{
state
.
isLoading
=
false
;
state
.
errorLoading
=
false
;
state
.
configuration
=
payload
;
},
[
types
.
RECEIVE_SECURITY_CONFIGURATION_ERROR
](
state
)
{
state
.
isLoading
=
false
;
state
.
errorLoading
=
true
;
},
};
ee/spec/frontend/security_configuration/modules/configuration/mutation_spec.js
View file @
a61e5877
...
...
@@ -21,6 +21,7 @@ describe('security configuration module mutations', () => {
it
(
'
should set the isLoading to true
'
,
()
=>
{
mutations
[
types
.
REQUEST_SECURITY_CONFIGURATION
](
state
);
expect
(
state
.
isLoading
).
toBe
(
true
);
expect
(
state
.
errorLoading
).
toBe
(
false
);
});
});
...
...
@@ -29,6 +30,7 @@ describe('security configuration module mutations', () => {
const
configuration
=
{};
mutations
[
types
.
RECEIVE_SECURITY_CONFIGURATION_SUCCESS
](
state
,
configuration
);
expect
(
state
.
isLoading
).
toBe
(
false
);
expect
(
state
.
errorLoading
).
toBe
(
false
);
expect
(
state
.
configuration
).
toBe
(
configuration
);
});
});
...
...
@@ -37,6 +39,7 @@ describe('security configuration module mutations', () => {
it
(
'
should set the isLoading to false
'
,
()
=>
{
mutations
[
types
.
RECEIVE_SECURITY_CONFIGURATION_ERROR
](
state
);
expect
(
state
.
isLoading
).
toBe
(
false
);
expect
(
state
.
errorLoading
).
toBe
(
true
);
});
});
});
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