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
0
Merge Requests
0
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
Jérome Perrin
gitlab-ce
Commits
1c1fef7a
Commit
1c1fef7a
authored
Aug 04, 2017
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ci skip] Adds tests cases
parent
08b76721
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
613 additions
and
1 deletion
+613
-1
app/assets/javascripts/notes/components/issue_notes_app.vue
app/assets/javascripts/notes/components/issue_notes_app.vue
+2
-0
spec/javascripts/notes/components/issue_comment_form_spec.js
spec/javascripts/notes/components/issue_comment_form_spec.js
+86
-0
spec/javascripts/notes/components/issue_discussion_spec.js
spec/javascripts/notes/components/issue_discussion_spec.js
+44
-0
spec/javascripts/notes/components/issue_note_actions_spec.js
spec/javascripts/notes/components/issue_note_actions_spec.js
+35
-0
spec/javascripts/notes/components/issue_note_app_spec.js
spec/javascripts/notes/components/issue_note_app_spec.js
+36
-0
spec/javascripts/notes/components/issue_note_awards_list_spec.js
...vascripts/notes/components/issue_note_awards_list_spec.js
+13
-0
spec/javascripts/notes/components/issue_note_body_spec.js
spec/javascripts/notes/components/issue_note_body_spec.js
+17
-0
spec/javascripts/notes/components/issue_note_edited_text_spec.js
...vascripts/notes/components/issue_note_edited_text_spec.js
+17
-0
spec/javascripts/notes/components/issue_note_form_spec.js
spec/javascripts/notes/components/issue_note_form_spec.js
+65
-0
spec/javascripts/notes/components/issue_note_header_spec.js
spec/javascripts/notes/components/issue_note_header_spec.js
+15
-0
spec/javascripts/notes/components/issue_note_signed_out_widget_spec.js
...pts/notes/components/issue_note_signed_out_widget_spec.js
+1
-1
spec/javascripts/notes/components/issue_note_spec.js
spec/javascripts/notes/components/issue_note_spec.js
+17
-0
spec/javascripts/notes/stores/actions_spec.js
spec/javascripts/notes/stores/actions_spec.js
+96
-0
spec/javascripts/notes/stores/getters_spec.js
spec/javascripts/notes/stores/getters_spec.js
+70
-0
spec/javascripts/notes/stores/mutation_spec.js
spec/javascripts/notes/stores/mutation_spec.js
+99
-0
No files found.
app/assets/javascripts/notes/components/issue_notes_app.vue
View file @
1c1fef7a
...
...
@@ -94,6 +94,8 @@
this
.
setLastFetchedAt
(
this
.
getNotesDataByProp
(
'
lastFetchedAt
'
));
this
.
poll
();
debugger
;
},
checkLocationHash
()
{
const
hash
=
gl
.
utils
.
getLocationHash
();
...
...
spec/javascripts/notes/components/issue_comment_form_spec.js
0 → 100644
View file @
1c1fef7a
describe
(
'
issue_comment_form component
'
,
()
=>
{
describe
(
'
user is logged in
'
,
()
=>
{
it
(
'
should render user avatar with link
'
,
()
=>
{
});
describe
(
'
textarea
'
,
()
=>
{
it
(
'
should render textarea with placeholder
'
,
()
=>
{
});
it
(
'
should support quick actions
'
,
()
=>
{
});
it
(
'
should link to markdown docs
'
,
()
=>
{
});
it
(
'
should link to quick actions docs
'
,
()
=>
{
});
describe
(
'
edit mode
'
,
()
=>
{
it
(
'
should enter edit mode when arrow up is pressed
'
,
()
=>
{
});
});
describe
(
'
preview mode
'
,
()
=>
{
it
(
'
should be possible to preview the note
'
,
()
=>
{
});
});
describe
(
'
event enter
'
,
()
=>
{
it
(
'
should save note when cmd/ctrl+enter is pressed
'
,
()
=>
{
});
});
});
describe
(
'
actions
'
,
()
=>
{
describe
(
'
with empty note
'
,
()
=>
{
it
(
'
should render dropdown as disabled
'
,
()
=>
{
});
});
describe
(
'
with note
'
,
()
=>
{
it
(
'
should render enabled dropdown with 2 actions
'
,
()
=>
{
});
it
(
'
should render be possible to discard draft
'
,
()
=>
{
});
});
describe
(
'
with open issue
'
,
()
=>
{
it
(
'
should be possible to close the issue
'
,
()
=>
{
});
});
describe
(
'
with closed issue
'
,
()
=>
{
it
(
'
should be possible to reopen the issue
'
,
()
=>
{
});
});
});
});
describe
(
'
user is not logged in
'
,
()
=>
{
it
(
'
should render signed out widget
'
,
()
=>
{
});
it
(
'
should not render submission form
'
,
()
=>
{
});
});
});
\ No newline at end of file
spec/javascripts/notes/components/issue_discussion_spec.js
0 → 100644
View file @
1c1fef7a
describe
(
'
issue_discussion component
'
,
()
=>
{
it
(
'
should render user avatar
'
,
()
=>
{
});
it
(
'
should render discussion header
'
,
()
=>
{
});
describe
(
'
updated note
'
,
()
=>
{
it
(
'
should show information about update
'
,
()
=>
{
});
});
describe
(
'
with open discussion
'
,
()
=>
{
it
(
'
should render system note
'
,
()
=>
{
});
it
(
'
should render placeholder note
'
,
()
=>
{
});
it
(
'
should render regular note
'
,
()
=>
{
});
describe
(
'
actions
'
,
()
=>
{
it
(
'
should render reply button
'
,
()
=>
{
});
it
(
'
should toggle reply form
'
,
()
=>
{
});
it
(
'
should render signout widget when user is logged out
'
,
()
=>
{
});
});
});
});
\ No newline at end of file
spec/javascripts/notes/components/issue_note_actions_spec.js
0 → 100644
View file @
1c1fef7a
describe
(
'
issse_note_actions component
'
,
()
=>
{
it
(
'
should render access level badge
'
,
()
=>
{
});
describe
(
'
user is logged in
'
,
()
=>
{
it
(
'
should render emoji link
'
,
()
=>
{
});
describe
(
'
actions dropdown
'
,
()
=>
{
it
(
'
should be possible to edit the comment
'
,
()
=>
{
});
it
(
'
should be possible to report as abuse
'
,
()
=>
{
});
it
(
'
should be possible to delete comment
'
,
()
=>
{
});
});
});
describe
(
'
user is not logged in
'
,
()
=>
{
it
(
'
should not render emoji link
'
,
()
=>
{
});
it
(
'
should not render actions dropdown
'
,
()
=>
{
});
});
});
\ No newline at end of file
spec/javascripts/notes/components/issue_note_app_spec.js
0 → 100644
View file @
1c1fef7a
describe
(
'
issue_note_app
'
,
()
=>
{
it
(
'
should set notes data
'
,
()
=>
{
});
it
(
'
should set issue data
'
,
()
=>
{
});
it
(
'
should set user data
'
,
()
=>
{
});
it
(
'
should fetch notes
'
,
()
=>
{
});
it
(
'
should render list of notes
'
,
()
=>
{
});
it
(
'
should render form
'
,
()
=>
{
});
describe
(
'
while fetching
'
,
()
=>
{
it
(
'
should render loading icon
'
,
()
=>
{
});
it
(
'
should render form
'
,
()
=>
{
});
});
});
\ No newline at end of file
spec/javascripts/notes/components/issue_note_awards_list_spec.js
0 → 100644
View file @
1c1fef7a
describe
(
'
issue_note_awards_list component
'
,
()
=>
{
it
(
'
should render awarded emojis
'
,
()
=>
{
});
it
(
'
should be possible to remove awareded emoji
'
,
()
=>
{
});
it
(
'
should be possible to add new emoji
'
,
()
=>
{
});
});
\ No newline at end of file
spec/javascripts/notes/components/issue_note_body_spec.js
0 → 100644
View file @
1c1fef7a
describe
(
'
issue_note_body component
'
,
()
=>
{
it
(
'
should render the note
'
,
()
=>
{
});
it
(
'
should be render form if user is editing
'
,
()
=>
{
});
it
(
'
should render information if note was edited
'
,
()
=>
{
});
it
(
'
should render awards list
'
,
()
=>
{
});
});
\ No newline at end of file
spec/javascripts/notes/components/issue_note_edited_text_spec.js
0 → 100644
View file @
1c1fef7a
describe
(
'
issue_note_edited_text
'
,
()
=>
{
it
(
'
should render block with provided className
'
,
()
=>
{
});
it
(
'
should render provided actionText
'
,
()
=>
{
});
it
(
'
should render time ago with provided timestamp
'
,
()
=>
{
});
it
(
'
should render provided user information
'
,
()
=>
{
});
});
\ No newline at end of file
spec/javascripts/notes/components/issue_note_form_spec.js
0 → 100644
View file @
1c1fef7a
describe
(
'
issue_note_form component
'
,
()
=>
{
describe
(
'
conflicts editing
'
,
()
=>
{
it
(
'
should show conflict message if note changes outside the component
'
,
()
=>
{
});
});
describe
(
'
form
'
,
()
=>
{
it
(
'
should render text area with placeholder
'
,
()
=>
{
});
it
(
'
should link to markdown docs
'
,
()
=>
{
});
it
(
'
should link to quick actions docs
'
,
()
=>
{
});
it
(
'
should preview the content
'
,
()
=>
{
});
it
(
'
should allow quick actions
'
,
()
=>
{
});
describe
(
'
keyboard events
'
,
()
=>
{
describe
(
'
up
'
,
()
=>
{
it
(
'
should ender edit mode
'
,
()
=>
{
});
});
describe
(
'
enter
'
,
()
=>
{
it
(
'
should submit note
'
,
()
=>
{
});
});
describe
(
'
esc
'
,
()
=>
{
it
(
'
should show exit
'
,
()
=>
{
});
});
});
describe
(
'
actions
'
,
()
=>
{
it
(
'
should be possible to cancel
'
,
()
=>
{
});
it
(
'
should be possible to update the note
'
,
()
=>
{
});
it
(
'
should not be possible to save an empty note
'
,
()
=>
{
});
});
});
});
\ No newline at end of file
spec/javascripts/notes/components/issue_note_header_spec.js
0 → 100644
View file @
1c1fef7a
describe
(
'
issue_note_header component
'
,
()
=>
{
it
(
'
should render user information
'
,
()
=>
{
});
it
(
'
should render timestamp link
'
,
()
=>
{
});
describe
(
'
discussion
'
,
()
=>
{
it
(
'
should render toggle button
'
,
()
=>
{
});
});
});
\ No newline at end of file
spec/javascripts/notes/components/issue_note_signed_out_widget_spec.js
View file @
1c1fef7a
describe
(
'
issue
note signed out
widget component
'
,
()
=>
{
describe
(
'
issue
_note_signed_out_
widget component
'
,
()
=>
{
it
(
'
should render sign in link provided in the store
'
,
()
=>
{
});
...
...
spec/javascripts/notes/components/issue_note_spec.js
0 → 100644
View file @
1c1fef7a
describe
(
'
issue_note
'
,
()
=>
{
it
(
'
should render user information
'
,
()
=>
{
});
it
(
'
should render note header content
'
,
()
=>
{
});
it
(
'
should render note actions
'
,
()
=>
{
});
it
(
'
should render issue body
'
,
()
=>
{
});
});
\ No newline at end of file
spec/javascripts/notes/stores/actions_spec.js
0 → 100644
View file @
1c1fef7a
import
*
as
actions
from
'
~/notes/stores/actions
'
;
describe
(
'
Actions Notes Store
'
,
()
=>
{
describe
(
'
setNotesData
'
,
()
=>
{
it
(
'
should set received notes data
'
,
()
=>
{
});
});
describe
(
'
setIssueData
'
,
()
=>
{
it
(
'
should set received issue data
'
,
()
=>
{});
});
describe
(
'
setUserData
'
,
()
=>
{
it
(
'
should set received user data
'
,
()
=>
{});
});
describe
(
'
setLastFetchedAt
'
,
()
=>
{
it
(
'
should set received timestamp
'
,
()
=>
{});
});
describe
(
'
setInitialNotes
'
,
()
=>
{
it
(
'
should set initial notes
'
,
()
=>
{
});
});
describe
(
'
setTargetNoteHash
'
,
()
=>
{
it
(
'
should set target note hash
'
,
()
=>
{});
});
describe
(
'
toggleDiscussion
'
,
()
=>
{
it
(
'
should toggle discussion
'
,
()
=>
{
});
});
describe
(
'
fetchNotes
'
,
()
=>
{
it
(
'
should request notes
'
,
()
=>
{
});
});
describe
(
'
deleteNote
'
,
()
=>
{
it
(
'
should delete note
'
,
()
=>
{});
});
describe
(
'
updateNote
'
,
()
=>
{
it
(
'
should update note
'
,
()
=>
{
});
});
describe
(
'
replyToDiscussion
'
,
()
=>
{
it
(
'
should add a reply to a discussion
'
,
()
=>
{
});
});
describe
(
'
createNewNote
'
,
()
=>
{
it
(
'
should create a new note
'
,
()
=>
{});
});
describe
(
'
saveNote
'
,
()
=>
{
it
(
'
should save the received note
'
,
()
=>
{
});
});
describe
(
'
poll
'
,
()
=>
{
it
(
'
should start polling the received endoint
'
,
()
=>
{
});
});
describe
(
'
toggleAward
'
,
()
=>
{
it
(
'
should toggle received award
'
,
()
=>
{
});
});
describe
(
'
toggleAwardRequest
'
,
()
=>
{
it
(
'
should make a request to toggle the award
'
,
()
=>
{
});
});
describe
(
'
scrollToNoteIfNeeded
'
,
()
=>
{
it
(
'
should call `scrollToElement` if note is not in viewport
'
,
()
=>
{
});
it
(
'
should note call `scrollToElement` if note is in viewport
'
,
()
=>
{
});
});
});
spec/javascripts/notes/stores/getters_spec.js
0 → 100644
View file @
1c1fef7a
import
{
getters
}
from
'
~/notes/stores/getters
'
;
describe
(
'
Getters Notes Store
'
,
()
=>
{
describe
(
'
notes
'
,
()
=>
{
it
(
'
should return all notes in the store
'
,
()
=>
{
});
});
describe
(
'
targetNoteHash
'
,
()
=>
{
it
(
'
should return `targetNoteHash`
'
,
()
=>
{
});
});
describe
(
'
getNotesData
'
,
()
=>
{
it
(
'
should return all data in `notesData`
'
,
()
=>
{
});
});
describe
(
'
getNotesDataByProp
'
,
()
=>
{
it
(
'
should return the given prop
'
,
()
=>
{
});
});
describe
(
'
getIssueData
'
,
()
=>
{
it
(
'
should return all data in `issueData`
'
,
()
=>
{
});
});
describe
(
'
getIssueDataByProp
'
,
()
=>
{
it
(
'
should return the given prop
'
,
()
=>
{
});
});
describe
(
'
getUserData
'
,
()
=>
{
it
(
'
should return all data in `userData`
'
,
()
=>
{
});
});
describe
(
'
getUserDataByProp
'
,
()
=>
{
it
(
'
should return the given prop
'
,
()
=>
{
});
});
describe
(
'
notesById
'
,
()
=>
{
it
(
'
should return the note for the given id
'
,
()
=>
{
});
});
describe
(
'
getCurrentUserLastNote
'
,
()
=>
{
it
(
'
should return the last note of the current user
'
,
()
=>
{
});
});
describe
(
'
getDiscussionLastNote
'
,
()
=>
{
it
(
'
should return the last discussion note of the current user
'
,
()
=>
{
});
});
});
spec/javascripts/notes/stores/mutation_spec.js
0 → 100644
View file @
1c1fef7a
import
{
mutations
}
from
'
~/notes/stores/mutations
'
;
describe
(
'
Mutation Notes Store
'
,
()
=>
{
describe
(
'
ADD_NEW_NOTE
'
,
()
=>
{
it
(
'
should add a new note to an array of notes
'
,
()
=>
{
});
});
describe
(
'
ADD_NEW_REPLY_TO_DISCUSSION
'
,
()
=>
{
it
(
'
should add a reply to a specific discussion
'
,
()
=>
{
});
});
describe
(
'
DELETE_NOTE
'
,
()
=>
{
it
(
'
should delete an indivudal note
'
,
()
=>
{
});
it
(
'
should delete a note from a discussion
'
,
()
=>
{
});
});
describe
(
'
REMOVE_PLACEHOLDER_NOTES
'
,
()
=>
{
it
(
'
should remove all placeholder notes in indivudal notes and discussion
'
,
()
=>
{
});
});
describe
(
'
SET_NOTES_DATA
'
,
()
=>
{
it
(
'
should set an object with notesData
'
,
()
=>
{
});
});
describe
(
'
SET_ISSUE_DATA
'
,
()
=>
{
it
(
'
should set the issue data
'
,
()
=>
{
});
});
describe
(
'
SET_USER_DATA
'
,
()
=>
{
it
(
'
should set the user data
'
,
()
=>
{
});
});
describe
(
'
SET_INITAL_NOTES
'
,
()
=>
{
it
(
'
should set the initial notes received
'
,
()
=>
{
});
});
describe
(
'
SET_LAST_FETCHED_AT
'
,
()
=>
{
it
(
'
should set timestamp
'
,
()
=>
{});
});
describe
(
'
SET_TARGET_NOTE_HASH
'
,
()
=>
{
it
(
'
should set the note hash
'
,
()
=>
{});
});
describe
(
'
SHOW_PLACEHOLDER_NOTE
'
,
()
=>
{
it
(
'
should set a placeholder note
'
,
()
=>
{
});
});
describe
(
'
TOGGLE_AWARD
'
,
()
=>
{
it
(
'
should add award if user has not reacted yet
'
,
()
=>
{
});
it
(
'
should remove award if user already reacted
'
,
()
=>
{
});
});
describe
(
'
TOGGLE_DISCUSSION
'
,
()
=>
{
it
(
'
should open a closed discussion
'
,
()
=>
{
});
it
(
'
should close a opened discussion
'
,
()
=>
{
});
});
describe
(
'
UPDATE_NOTE
'
,
()
=>
{
it
(
'
should update an individual note
'
,
()
=>
{
});
it
(
'
should update a note in a discussion
'
,
()
=>
{
});
});
});
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