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
9a326fa7
Commit
9a326fa7
authored
Mar 16, 2021
by
Thomas Randolph
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a mutator action to set the MR Metadata
parent
17c3dcf6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
1 deletion
+25
-1
app/assets/javascripts/mr_notes/stores/actions.js
app/assets/javascripts/mr_notes/stores/actions.js
+4
-0
spec/frontend/mr_notes/stores/actions_spec.js
spec/frontend/mr_notes/stores/actions_spec.js
+21
-1
No files found.
app/assets/javascripts/mr_notes/stores/actions.js
View file @
9a326fa7
...
...
@@ -7,3 +7,7 @@ export function setActiveTab({ commit }, tab) {
export
function
setEndpoints
({
commit
},
endpoints
)
{
commit
(
types
.
SET_ENDPOINTS
,
endpoints
);
}
export
function
setMrMetadata
({
commit
},
metadata
)
{
commit
(
types
.
SET_MR_METADATA
,
metadata
);
}
spec/frontend/mr_notes/stores/actions_spec.js
View file @
9a326fa7
import
testAction
from
'
helpers/vuex_action_helper
'
;
import
{
setEndpoints
}
from
'
~/mr_notes/stores/actions
'
;
import
{
setEndpoints
,
setMrMetadata
}
from
'
~/mr_notes/stores/actions
'
;
import
mutationTypes
from
'
~/mr_notes/stores/mutation_types
'
;
describe
(
'
MR Notes Mutator Actions
'
,
()
=>
{
...
...
@@ -22,4 +22,24 @@ describe('MR Notes Mutator Actions', () => {
);
});
});
describe
(
'
setMrMetadata
'
,
()
=>
{
it
(
'
should trigger the SET_MR_METADATA state mutation
'
,
(
done
)
=>
{
const
mrMetadata
=
{
propA
:
'
a
'
,
propB
:
'
b
'
};
testAction
(
setMrMetadata
,
mrMetadata
,
{},
[
{
type
:
mutationTypes
.
SET_MR_METADATA
,
payload
:
mrMetadata
,
},
],
[],
done
,
);
});
});
});
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