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
583fa6e6
Commit
583fa6e6
authored
Nov 28, 2017
by
Simon Knox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
issueData -> noteableData
parent
c97b60cb
Changes
22
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
64 additions
and
64 deletions
+64
-64
app/assets/javascripts/notes/components/issue_comment_form.vue
...ssets/javascripts/notes/components/issue_comment_form.vue
+11
-11
app/assets/javascripts/notes/components/issue_discussion.vue
app/assets/javascripts/notes/components/issue_discussion.vue
+3
-3
app/assets/javascripts/notes/components/issue_note_form.vue
app/assets/javascripts/notes/components/issue_note_form.vue
+6
-6
app/assets/javascripts/notes/components/issue_notes_app.vue
app/assets/javascripts/notes/components/issue_notes_app.vue
+3
-3
app/assets/javascripts/notes/index.js
app/assets/javascripts/notes/index.js
+2
-2
app/assets/javascripts/notes/stores/actions.js
app/assets/javascripts/notes/stores/actions.js
+1
-1
app/assets/javascripts/notes/stores/getters.js
app/assets/javascripts/notes/stores/getters.js
+2
-2
app/assets/javascripts/notes/stores/index.js
app/assets/javascripts/notes/stores/index.js
+1
-1
app/assets/javascripts/notes/stores/mutation_types.js
app/assets/javascripts/notes/stores/mutation_types.js
+1
-1
app/assets/javascripts/notes/stores/mutations.js
app/assets/javascripts/notes/stores/mutations.js
+2
-2
app/views/projects/issues/_discussion.html.haml
app/views/projects/issues/_discussion.html.haml
+1
-1
spec/javascripts/notes/components/issue_comment_form_spec.js
spec/javascripts/notes/components/issue_comment_form_spec.js
+4
-4
spec/javascripts/notes/components/issue_discussion_spec.js
spec/javascripts/notes/components/issue_discussion_spec.js
+2
-2
spec/javascripts/notes/components/issue_note_app_spec.js
spec/javascripts/notes/components/issue_note_app_spec.js
+2
-2
spec/javascripts/notes/components/issue_note_awards_list_spec.js
...vascripts/notes/components/issue_note_awards_list_spec.js
+2
-2
spec/javascripts/notes/components/issue_note_body_spec.js
spec/javascripts/notes/components/issue_note_body_spec.js
+2
-2
spec/javascripts/notes/components/issue_note_form_spec.js
spec/javascripts/notes/components/issue_note_form_spec.js
+2
-2
spec/javascripts/notes/components/issue_note_spec.js
spec/javascripts/notes/components/issue_note_spec.js
+2
-2
spec/javascripts/notes/mock_data.js
spec/javascripts/notes/mock_data.js
+1
-1
spec/javascripts/notes/stores/actions_spec.js
spec/javascripts/notes/stores/actions_spec.js
+4
-4
spec/javascripts/notes/stores/getters_spec.js
spec/javascripts/notes/stores/getters_spec.js
+5
-5
spec/javascripts/notes/stores/mutation_spec.js
spec/javascripts/notes/stores/mutation_spec.js
+5
-5
No files found.
app/assets/javascripts/notes/components/issue_comment_form.vue
View file @
583fa6e6
...
...
@@ -22,7 +22,7 @@
noteType
:
constants
.
COMMENT
,
// Can't use mapGetters,
// this needs to be in the data object because it belongs to the state
issueState
:
this
.
$store
.
getters
.
get
Issu
eData
.
state
,
issueState
:
this
.
$store
.
getters
.
get
Noteabl
eData
.
state
,
isSubmitting
:
false
,
isSubmitButtonDisabled
:
true
,
};
...
...
@@ -46,7 +46,7 @@
...
mapGetters
([
'
getCurrentUserLastNote
'
,
'
getUserData
'
,
'
get
Issu
eData
'
,
'
get
Noteabl
eData
'
,
'
getNotesData
'
,
]),
isLoggedIn
()
{
...
...
@@ -59,7 +59,7 @@
return
this
.
issueState
===
constants
.
OPENED
||
this
.
issueState
===
constants
.
REOPENED
;
},
canCreateNote
()
{
return
this
.
get
Issu
eData
.
current_user
.
can_create_note
;
return
this
.
get
Noteabl
eData
.
current_user
.
can_create_note
;
},
issueActionButtonTitle
()
{
if
(
this
.
note
.
length
)
{
...
...
@@ -85,16 +85,16 @@
return
this
.
getNotesData
.
quickActionsDocsPath
;
},
markdownPreviewPath
()
{
return
this
.
get
Issu
eData
.
preview_note_path
;
return
this
.
get
Noteabl
eData
.
preview_note_path
;
},
author
()
{
return
this
.
getUserData
;
},
canUpdateIssue
()
{
return
this
.
get
Issu
eData
.
current_user
.
can_update
;
return
this
.
get
Noteabl
eData
.
current_user
.
can_update
;
},
endpoint
()
{
return
this
.
get
Issu
eData
.
create_note_path
;
return
this
.
get
Noteabl
eData
.
create_note_path
;
},
},
methods
:
{
...
...
@@ -119,7 +119,7 @@
data
:
{
note
:
{
noteable_type
:
constants
.
NOTEABLE_TYPE
,
noteable_id
:
this
.
get
Issu
eData
.
id
,
noteable_id
:
this
.
get
Noteabl
eData
.
id
,
note
:
this
.
note
,
},
},
...
...
@@ -207,7 +207,7 @@
},
initAutoSave
()
{
if
(
this
.
isLoggedIn
)
{
this
.
autosave
=
new
Autosave
(
$
(
this
.
$refs
.
textarea
),
[
'
Note
'
,
'
Issue
'
,
this
.
get
Issu
eData
.
id
],
'
issue
'
);
this
.
autosave
=
new
Autosave
(
$
(
this
.
$refs
.
textarea
),
[
'
Note
'
,
'
Issue
'
,
this
.
get
Noteabl
eData
.
id
],
'
issue
'
);
}
},
initTaskList
()
{
...
...
@@ -266,9 +266,9 @@
<div
class=
"error-alert"
></div>
<issue-warning
v-if=
"hasWarning(get
Issu
eData)"
:is-locked=
"isLocked(get
Issu
eData)"
:is-confidential=
"isConfidential(get
Issu
eData)"
v-if=
"hasWarning(get
Noteabl
eData)"
:is-locked=
"isLocked(get
Noteabl
eData)"
:is-confidential=
"isConfidential(get
Noteabl
eData)"
/>
<markdown-field
...
...
app/assets/javascripts/notes/components/issue_discussion.vue
View file @
583fa6e6
...
...
@@ -41,7 +41,7 @@
],
computed
:
{
...
mapGetters
([
'
get
Issu
eData
'
,
'
get
Noteabl
eData
'
,
]),
discussion
()
{
return
this
.
note
.
notes
[
0
];
...
...
@@ -50,10 +50,10 @@
return
this
.
discussion
.
author
;
},
canReply
()
{
return
this
.
get
Issu
eData
.
current_user
.
can_create_note
;
return
this
.
get
Noteabl
eData
.
current_user
.
can_create_note
;
},
newNotePath
()
{
return
this
.
get
Issu
eData
.
create_note_path
;
return
this
.
get
Noteabl
eData
.
create_note_path
;
},
lastUpdatedBy
()
{
const
{
notes
}
=
this
.
note
;
...
...
app/assets/javascripts/notes/components/issue_note_form.vue
View file @
583fa6e6
...
...
@@ -46,8 +46,8 @@
computed
:
{
...
mapGetters
([
'
getDiscussionLastNote
'
,
'
get
Issu
eData
'
,
'
get
Issu
eDataByProp
'
,
'
get
Noteabl
eData
'
,
'
get
Noteabl
eDataByProp
'
,
'
getNotesDataByProp
'
,
'
getUserDataByProp
'
,
]),
...
...
@@ -55,7 +55,7 @@
return
`#note_
${
this
.
noteId
}
`
;
},
markdownPreviewPath
()
{
return
this
.
get
Issu
eDataByProp
(
'
preview_note_path
'
);
return
this
.
get
Noteabl
eDataByProp
(
'
preview_note_path
'
);
},
markdownDocsPath
()
{
return
this
.
getNotesDataByProp
(
'
markdownDocsPath
'
);
...
...
@@ -129,9 +129,9 @@
class=
"edit-note common-note-form js-quick-submit gfm-form"
>
<issue-warning
v-if=
"hasWarning(get
Issu
eData)"
:is-locked=
"isLocked(get
Issu
eData)"
:is-confidential=
"isConfidential(get
Issu
eData)"
v-if=
"hasWarning(get
Noteabl
eData)"
:is-locked=
"isLocked(get
Noteabl
eData)"
:is-confidential=
"isConfidential(get
Noteabl
eData)"
/>
<markdown-field
...
...
app/assets/javascripts/notes/components/issue_notes_app.vue
View file @
583fa6e6
...
...
@@ -14,7 +14,7 @@
export
default
{
name
:
'
issueNotesApp
'
,
props
:
{
issu
eData
:
{
noteabl
eData
:
{
type
:
Object
,
required
:
true
,
},
...
...
@@ -56,7 +56,7 @@
actionToggleAward
:
'
toggleAward
'
,
scrollToNoteIfNeeded
:
'
scrollToNoteIfNeeded
'
,
setNotesData
:
'
setNotesData
'
,
set
IssueData
:
'
setIssu
eData
'
,
set
NoteableData
:
'
setNoteabl
eData
'
,
setUserData
:
'
setUserData
'
,
setLastFetchedAt
:
'
setLastFetchedAt
'
,
setTargetNoteHash
:
'
setTargetNoteHash
'
,
...
...
@@ -106,7 +106,7 @@
},
created
()
{
this
.
setNotesData
(
this
.
notesData
);
this
.
set
IssueData
(
this
.
issu
eData
);
this
.
set
NoteableData
(
this
.
noteabl
eData
);
this
.
setUserData
(
this
.
userData
);
},
mounted
()
{
...
...
app/assets/javascripts/notes/index.js
View file @
583fa6e6
...
...
@@ -10,7 +10,7 @@ document.addEventListener('DOMContentLoaded', () => new Vue({
const
notesDataset
=
document
.
getElementById
(
'
js-vue-notes
'
).
dataset
;
return
{
issueData
:
JSON
.
parse
(
notesDataset
.
issu
eData
),
noteableData
:
JSON
.
parse
(
notesDataset
.
noteabl
eData
),
currentUserData
:
JSON
.
parse
(
notesDataset
.
currentUserData
),
notesData
:
{
lastFetchedAt
:
notesDataset
.
lastFetchedAt
,
...
...
@@ -26,7 +26,7 @@ document.addEventListener('DOMContentLoaded', () => new Vue({
render
(
createElement
)
{
return
createElement
(
'
issue-notes-app
'
,
{
props
:
{
issueData
:
this
.
issu
eData
,
noteableData
:
this
.
noteabl
eData
,
notesData
:
this
.
notesData
,
userData
:
this
.
currentUserData
,
},
...
...
app/assets/javascripts/notes/stores/actions.js
View file @
583fa6e6
...
...
@@ -12,7 +12,7 @@ import { isInViewport, scrollToElement } from '../../lib/utils/common_utils';
let
eTagPoll
;
export
const
setNotesData
=
({
commit
},
data
)
=>
commit
(
types
.
SET_NOTES_DATA
,
data
);
export
const
set
IssueData
=
({
commit
},
data
)
=>
commit
(
types
.
SET_ISSU
E_DATA
,
data
);
export
const
set
NoteableData
=
({
commit
},
data
)
=>
commit
(
types
.
SET_NOTEABL
E_DATA
,
data
);
export
const
setUserData
=
({
commit
},
data
)
=>
commit
(
types
.
SET_USER_DATA
,
data
);
export
const
setLastFetchedAt
=
({
commit
},
data
)
=>
commit
(
types
.
SET_LAST_FETCHED_AT
,
data
);
export
const
setInitialNotes
=
({
commit
},
data
)
=>
commit
(
types
.
SET_INITIAL_NOTES
,
data
);
...
...
app/assets/javascripts/notes/stores/getters.js
View file @
583fa6e6
...
...
@@ -6,8 +6,8 @@ export const targetNoteHash = state => state.targetNoteHash;
export
const
getNotesData
=
state
=>
state
.
notesData
;
export
const
getNotesDataByProp
=
state
=>
prop
=>
state
.
notesData
[
prop
];
export
const
get
IssueData
=
state
=>
state
.
issu
eData
;
export
const
get
IssueDataByProp
=
state
=>
prop
=>
state
.
issu
eData
[
prop
];
export
const
get
NoteableData
=
state
=>
state
.
noteabl
eData
;
export
const
get
NoteableDataByProp
=
state
=>
prop
=>
state
.
noteabl
eData
[
prop
];
export
const
getUserData
=
state
=>
state
.
userData
||
{};
export
const
getUserDataByProp
=
state
=>
prop
=>
state
.
userData
&&
state
.
userData
[
prop
];
...
...
app/assets/javascripts/notes/stores/index.js
View file @
583fa6e6
...
...
@@ -15,7 +15,7 @@ export default new Vuex.Store({
// holds endpoints and permissions provided through haml
notesData
:
{},
userData
:
{},
issu
eData
:
{},
noteabl
eData
:
{},
},
actions
,
getters
,
...
...
app/assets/javascripts/notes/stores/mutation_types.js
View file @
583fa6e6
...
...
@@ -3,7 +3,7 @@ export const ADD_NEW_REPLY_TO_DISCUSSION = 'ADD_NEW_REPLY_TO_DISCUSSION';
export
const
DELETE_NOTE
=
'
DELETE_NOTE
'
;
export
const
REMOVE_PLACEHOLDER_NOTES
=
'
REMOVE_PLACEHOLDER_NOTES
'
;
export
const
SET_NOTES_DATA
=
'
SET_NOTES_DATA
'
;
export
const
SET_
ISSUE_DATA
=
'
SET_ISSU
E_DATA
'
;
export
const
SET_
NOTEABLE_DATA
=
'
SET_NOTEABL
E_DATA
'
;
export
const
SET_USER_DATA
=
'
SET_USER_DATA
'
;
export
const
SET_INITIAL_NOTES
=
'
SET_INITIAL_NOTES
'
;
export
const
SET_LAST_FETCHED_AT
=
'
SET_LAST_FETCHED_AT
'
;
...
...
app/assets/javascripts/notes/stores/mutations.js
View file @
583fa6e6
...
...
@@ -66,8 +66,8 @@ export default {
Object
.
assign
(
state
,
{
notesData
:
data
});
},
[
types
.
SET_
ISSU
E_DATA
](
state
,
data
)
{
Object
.
assign
(
state
,
{
issu
eData
:
data
});
[
types
.
SET_
NOTEABL
E_DATA
](
state
,
data
)
{
Object
.
assign
(
state
,
{
noteabl
eData
:
data
});
},
[
types
.
SET_USER_DATA
](
state
,
data
)
{
...
...
app/views/projects/issues/_discussion.html.haml
View file @
583fa6e6
...
...
@@ -13,5 +13,5 @@
quick_actions_docs_path:
help_page_path
(
'user/project/quick_actions'
),
notes_path:
notes_url
,
last_fetched_at:
Time
.
now
.
to_i
,
issu
e_data:
serialize_issuable
(
@issue
),
noteabl
e_data:
serialize_issuable
(
@issue
),
current_user_data:
UserSerializer
.
new
.
represent
(
current_user
).
to_json
}
}
spec/javascripts/notes/components/issue_comment_form_spec.js
View file @
583fa6e6
...
...
@@ -2,7 +2,7 @@ import Vue from 'vue';
import
Autosize
from
'
autosize
'
;
import
store
from
'
~/notes/stores
'
;
import
issueCommentForm
from
'
~/notes/components/issue_comment_form.vue
'
;
import
{
loggedOutIssueData
,
notesDataMock
,
userDataMock
,
issu
eDataMock
}
from
'
../mock_data
'
;
import
{
loggedOutIssueData
,
notesDataMock
,
userDataMock
,
noteabl
eDataMock
}
from
'
../mock_data
'
;
import
{
keyboardDownEvent
}
from
'
../../issue_show/helpers
'
;
describe
(
'
issue_comment_form component
'
,
()
=>
{
...
...
@@ -23,7 +23,7 @@ describe('issue_comment_form component', () => {
describe
(
'
user is logged in
'
,
()
=>
{
beforeEach
(()
=>
{
store
.
dispatch
(
'
setUserData
'
,
userDataMock
);
store
.
dispatch
(
'
set
IssueData
'
,
issu
eDataMock
);
store
.
dispatch
(
'
set
NoteableData
'
,
noteabl
eDataMock
);
store
.
dispatch
(
'
setNotesData
'
,
notesDataMock
);
vm
=
mountComponent
();
...
...
@@ -178,7 +178,7 @@ describe('issue_comment_form component', () => {
describe
(
'
issue is confidential
'
,
()
=>
{
it
(
'
shows information warning
'
,
(
done
)
=>
{
store
.
dispatch
(
'
set
IssueData
'
,
Object
.
assign
(
issu
eDataMock
,
{
confidential
:
true
}));
store
.
dispatch
(
'
set
NoteableData
'
,
Object
.
assign
(
noteabl
eDataMock
,
{
confidential
:
true
}));
Vue
.
nextTick
(()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.confidential-issue-warning
'
)).
toBeDefined
();
done
();
...
...
@@ -190,7 +190,7 @@ describe('issue_comment_form component', () => {
describe
(
'
user is not logged in
'
,
()
=>
{
beforeEach
(()
=>
{
store
.
dispatch
(
'
setUserData
'
,
null
);
store
.
dispatch
(
'
set
Issu
eData
'
,
loggedOutIssueData
);
store
.
dispatch
(
'
set
Noteabl
eData
'
,
loggedOutIssueData
);
store
.
dispatch
(
'
setNotesData
'
,
notesDataMock
);
vm
=
mountComponent
();
...
...
spec/javascripts/notes/components/issue_discussion_spec.js
View file @
583fa6e6
import
Vue
from
'
vue
'
;
import
store
from
'
~/notes/stores
'
;
import
issueDiscussion
from
'
~/notes/components/issue_discussion.vue
'
;
import
{
issu
eDataMock
,
discussionMock
,
notesDataMock
}
from
'
../mock_data
'
;
import
{
noteabl
eDataMock
,
discussionMock
,
notesDataMock
}
from
'
../mock_data
'
;
describe
(
'
issue_discussion component
'
,
()
=>
{
let
vm
;
...
...
@@ -9,7 +9,7 @@ describe('issue_discussion component', () => {
beforeEach
(()
=>
{
const
Component
=
Vue
.
extend
(
issueDiscussion
);
store
.
dispatch
(
'
set
IssueData
'
,
issu
eDataMock
);
store
.
dispatch
(
'
set
NoteableData
'
,
noteabl
eDataMock
);
store
.
dispatch
(
'
setNotesData
'
,
notesDataMock
);
vm
=
new
Component
({
...
...
spec/javascripts/notes/components/issue_note_app_spec.js
View file @
583fa6e6
...
...
@@ -24,7 +24,7 @@ describe('issue_note_app', () => {
mountComponent
=
(
data
)
=>
{
const
props
=
data
||
{
issueData
:
mockData
.
issu
eDataMock
,
noteableData
:
mockData
.
noteabl
eDataMock
,
notesData
:
mockData
.
notesDataMock
,
userData
:
mockData
.
userDataMock
,
};
...
...
@@ -60,7 +60,7 @@ describe('issue_note_app', () => {
});
it
(
'
should set issue data
'
,
()
=>
{
expect
(
vm
.
$store
.
state
.
issueData
).
toEqual
(
mockData
.
issu
eDataMock
);
expect
(
vm
.
$store
.
state
.
noteableData
).
toEqual
(
mockData
.
noteabl
eDataMock
);
});
it
(
'
should set user data
'
,
()
=>
{
...
...
spec/javascripts/notes/components/issue_note_awards_list_spec.js
View file @
583fa6e6
import
Vue
from
'
vue
'
;
import
store
from
'
~/notes/stores
'
;
import
awardsNote
from
'
~/notes/components/issue_note_awards_list.vue
'
;
import
{
issu
eDataMock
,
notesDataMock
}
from
'
../mock_data
'
;
import
{
noteabl
eDataMock
,
notesDataMock
}
from
'
../mock_data
'
;
describe
(
'
issue_note_awards_list component
'
,
()
=>
{
let
vm
;
...
...
@@ -10,7 +10,7 @@ describe('issue_note_awards_list component', () => {
beforeEach
(()
=>
{
const
Component
=
Vue
.
extend
(
awardsNote
);
store
.
dispatch
(
'
set
IssueData
'
,
issu
eDataMock
);
store
.
dispatch
(
'
set
NoteableData
'
,
noteabl
eDataMock
);
store
.
dispatch
(
'
setNotesData
'
,
notesDataMock
);
awardsMock
=
[
{
...
...
spec/javascripts/notes/components/issue_note_body_spec.js
View file @
583fa6e6
...
...
@@ -2,7 +2,7 @@
import
Vue
from
'
vue
'
;
import
store
from
'
~/notes/stores
'
;
import
noteBody
from
'
~/notes/components/issue_note_body.vue
'
;
import
{
issu
eDataMock
,
notesDataMock
,
note
}
from
'
../mock_data
'
;
import
{
noteabl
eDataMock
,
notesDataMock
,
note
}
from
'
../mock_data
'
;
describe
(
'
issue_note_body component
'
,
()
=>
{
let
vm
;
...
...
@@ -10,7 +10,7 @@ describe('issue_note_body component', () => {
beforeEach
(()
=>
{
const
Component
=
Vue
.
extend
(
noteBody
);
store
.
dispatch
(
'
set
IssueData
'
,
issu
eDataMock
);
store
.
dispatch
(
'
set
NoteableData
'
,
noteabl
eDataMock
);
store
.
dispatch
(
'
setNotesData
'
,
notesDataMock
);
vm
=
new
Component
({
...
...
spec/javascripts/notes/components/issue_note_form_spec.js
View file @
583fa6e6
import
Vue
from
'
vue
'
;
import
store
from
'
~/notes/stores
'
;
import
issueNoteForm
from
'
~/notes/components/issue_note_form.vue
'
;
import
{
issu
eDataMock
,
notesDataMock
}
from
'
../mock_data
'
;
import
{
noteabl
eDataMock
,
notesDataMock
}
from
'
../mock_data
'
;
import
{
keyboardDownEvent
}
from
'
../../issue_show/helpers
'
;
describe
(
'
issue_note_form component
'
,
()
=>
{
...
...
@@ -11,7 +11,7 @@ describe('issue_note_form component', () => {
beforeEach
(()
=>
{
const
Component
=
Vue
.
extend
(
issueNoteForm
);
store
.
dispatch
(
'
set
IssueData
'
,
issu
eDataMock
);
store
.
dispatch
(
'
set
NoteableData
'
,
noteabl
eDataMock
);
store
.
dispatch
(
'
setNotesData
'
,
notesDataMock
);
props
=
{
...
...
spec/javascripts/notes/components/issue_note_spec.js
View file @
583fa6e6
...
...
@@ -2,7 +2,7 @@
import
Vue
from
'
vue
'
;
import
store
from
'
~/notes/stores
'
;
import
issueNote
from
'
~/notes/components/issue_note.vue
'
;
import
{
issu
eDataMock
,
notesDataMock
,
note
}
from
'
../mock_data
'
;
import
{
noteabl
eDataMock
,
notesDataMock
,
note
}
from
'
../mock_data
'
;
describe
(
'
issue_note
'
,
()
=>
{
let
vm
;
...
...
@@ -10,7 +10,7 @@ describe('issue_note', () => {
beforeEach
(()
=>
{
const
Component
=
Vue
.
extend
(
issueNote
);
store
.
dispatch
(
'
set
IssueData
'
,
issu
eDataMock
);
store
.
dispatch
(
'
set
NoteableData
'
,
noteabl
eDataMock
);
store
.
dispatch
(
'
setNotesData
'
,
notesDataMock
);
vm
=
new
Component
({
...
...
spec/javascripts/notes/mock_data.js
View file @
583fa6e6
...
...
@@ -18,7 +18,7 @@ export const userDataMock = {
username
:
'
root
'
,
};
export
const
issu
eDataMock
=
{
export
const
noteabl
eDataMock
=
{
assignees
:
[],
author_id
:
1
,
branch_name
:
null
,
...
...
spec/javascripts/notes/stores/actions_spec.js
View file @
583fa6e6
import
*
as
actions
from
'
~/notes/stores/actions
'
;
import
testAction
from
'
../../helpers/vuex_action_helper
'
;
import
{
discussionMock
,
notesDataMock
,
userDataMock
,
issu
eDataMock
,
individualNote
}
from
'
../mock_data
'
;
import
{
discussionMock
,
notesDataMock
,
userDataMock
,
noteabl
eDataMock
,
individualNote
}
from
'
../mock_data
'
;
describe
(
'
Actions Notes Store
'
,
()
=>
{
describe
(
'
setNotesData
'
,
()
=>
{
...
...
@@ -11,10 +11,10 @@ describe('Actions Notes Store', () => {
});
});
describe
(
'
set
Issu
eData
'
,
()
=>
{
describe
(
'
set
Noteabl
eData
'
,
()
=>
{
it
(
'
should set received issue data
'
,
(
done
)
=>
{
testAction
(
actions
.
set
IssueData
,
null
,
{
issu
eData
:
{}
},
[
{
type
:
'
SET_
ISSUE_DATA
'
,
payload
:
issu
eDataMock
},
testAction
(
actions
.
set
NoteableData
,
null
,
{
noteabl
eData
:
{}
},
[
{
type
:
'
SET_
NOTEABLE_DATA
'
,
payload
:
noteabl
eDataMock
},
],
done
);
});
});
...
...
spec/javascripts/notes/stores/getters_spec.js
View file @
583fa6e6
import
*
as
getters
from
'
~/notes/stores/getters
'
;
import
{
notesDataMock
,
userDataMock
,
issu
eDataMock
,
individualNote
}
from
'
../mock_data
'
;
import
{
notesDataMock
,
userDataMock
,
noteabl
eDataMock
,
individualNote
}
from
'
../mock_data
'
;
describe
(
'
Getters Notes Store
'
,
()
=>
{
let
state
;
...
...
@@ -11,7 +11,7 @@ describe('Getters Notes Store', () => {
notesData
:
notesDataMock
,
userData
:
userDataMock
,
issueData
:
issu
eDataMock
,
noteableData
:
noteabl
eDataMock
,
};
});
describe
(
'
notes
'
,
()
=>
{
...
...
@@ -32,9 +32,9 @@ describe('Getters Notes Store', () => {
});
});
describe
(
'
get
Issu
eData
'
,
()
=>
{
it
(
'
should return all data in `
issu
eData`
'
,
()
=>
{
expect
(
getters
.
get
IssueData
(
state
)).
toEqual
(
issu
eDataMock
);
describe
(
'
get
Noteabl
eData
'
,
()
=>
{
it
(
'
should return all data in `
noteabl
eData`
'
,
()
=>
{
expect
(
getters
.
get
NoteableData
(
state
)).
toEqual
(
noteabl
eDataMock
);
});
});
...
...
spec/javascripts/notes/stores/mutation_spec.js
View file @
583fa6e6
import
mutations
from
'
~/notes/stores/mutations
'
;
import
{
note
,
discussionMock
,
notesDataMock
,
userDataMock
,
issu
eDataMock
,
individualNote
}
from
'
../mock_data
'
;
import
{
note
,
discussionMock
,
notesDataMock
,
userDataMock
,
noteabl
eDataMock
,
individualNote
}
from
'
../mock_data
'
;
describe
(
'
Mutation Notes Store
'
,
()
=>
{
describe
(
'
ADD_NEW_NOTE
'
,
()
=>
{
...
...
@@ -74,14 +74,14 @@ describe('Mutation Notes Store', () => {
});
});
describe
(
'
SET_
ISSU
E_DATA
'
,
()
=>
{
describe
(
'
SET_
NOTEABL
E_DATA
'
,
()
=>
{
it
(
'
should set the issue data
'
,
()
=>
{
const
state
=
{
issu
eData
:
{},
noteabl
eData
:
{},
};
mutations
.
SET_
ISSUE_DATA
(
state
,
issu
eDataMock
);
expect
(
state
.
issueData
).
toEqual
(
issu
eDataMock
);
mutations
.
SET_
NOTEABLE_DATA
(
state
,
noteabl
eDataMock
);
expect
(
state
.
noteableData
).
toEqual
(
noteabl
eDataMock
);
});
});
...
...
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