summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2017-08-04 16:51:35 +0100
committerFilipa Lacerda <filipa@gitlab.com>2017-08-04 16:51:35 +0100
commit1c1fef7af3772c2e8baaf83516a43caa7ac8e6fc (patch)
tree64a6c6fca23a0205d93735da9652bb841c64b0ec
parent08b76721f3efb38b9e379eabce3a8c8a09de4f87 (diff)
downloadgitlab-ce-1c1fef7af3772c2e8baaf83516a43caa7ac8e6fc.tar.gz
[ci skip] Adds tests cases
-rw-r--r--app/assets/javascripts/notes/components/issue_notes_app.vue2
-rw-r--r--spec/javascripts/notes/components/issue_comment_form_spec.js86
-rw-r--r--spec/javascripts/notes/components/issue_discussion_spec.js44
-rw-r--r--spec/javascripts/notes/components/issue_note_actions_spec.js35
-rw-r--r--spec/javascripts/notes/components/issue_note_app_spec.js36
-rw-r--r--spec/javascripts/notes/components/issue_note_awards_list_spec.js13
-rw-r--r--spec/javascripts/notes/components/issue_note_body_spec.js17
-rw-r--r--spec/javascripts/notes/components/issue_note_edited_text_spec.js17
-rw-r--r--spec/javascripts/notes/components/issue_note_form_spec.js65
-rw-r--r--spec/javascripts/notes/components/issue_note_header_spec.js15
-rw-r--r--spec/javascripts/notes/components/issue_note_signed_out_widget_spec.js2
-rw-r--r--spec/javascripts/notes/components/issue_note_spec.js17
-rw-r--r--spec/javascripts/notes/stores/actions_spec.js96
-rw-r--r--spec/javascripts/notes/stores/getters_spec.js70
-rw-r--r--spec/javascripts/notes/stores/mutation_spec.js99
15 files changed, 613 insertions, 1 deletions
diff --git a/app/assets/javascripts/notes/components/issue_notes_app.vue b/app/assets/javascripts/notes/components/issue_notes_app.vue
index 4c0351f701b..2d26d77d519 100644
--- a/app/assets/javascripts/notes/components/issue_notes_app.vue
+++ b/app/assets/javascripts/notes/components/issue_notes_app.vue
@@ -94,6 +94,8 @@
this.setLastFetchedAt(this.getNotesDataByProp('lastFetchedAt'));
this.poll();
+
+ debugger;
},
checkLocationHash() {
const hash = gl.utils.getLocationHash();
diff --git a/spec/javascripts/notes/components/issue_comment_form_spec.js b/spec/javascripts/notes/components/issue_comment_form_spec.js
new file mode 100644
index 00000000000..389ccd6e886
--- /dev/null
+++ b/spec/javascripts/notes/components/issue_comment_form_spec.js
@@ -0,0 +1,86 @@
+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
diff --git a/spec/javascripts/notes/components/issue_discussion_spec.js b/spec/javascripts/notes/components/issue_discussion_spec.js
new file mode 100644
index 00000000000..3d6b45d2dad
--- /dev/null
+++ b/spec/javascripts/notes/components/issue_discussion_spec.js
@@ -0,0 +1,44 @@
+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
diff --git a/spec/javascripts/notes/components/issue_note_actions_spec.js b/spec/javascripts/notes/components/issue_note_actions_spec.js
new file mode 100644
index 00000000000..f23c73dd73f
--- /dev/null
+++ b/spec/javascripts/notes/components/issue_note_actions_spec.js
@@ -0,0 +1,35 @@
+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
diff --git a/spec/javascripts/notes/components/issue_note_app_spec.js b/spec/javascripts/notes/components/issue_note_app_spec.js
new file mode 100644
index 00000000000..df8d250ed5e
--- /dev/null
+++ b/spec/javascripts/notes/components/issue_note_app_spec.js
@@ -0,0 +1,36 @@
+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
diff --git a/spec/javascripts/notes/components/issue_note_awards_list_spec.js b/spec/javascripts/notes/components/issue_note_awards_list_spec.js
new file mode 100644
index 00000000000..8620932004d
--- /dev/null
+++ b/spec/javascripts/notes/components/issue_note_awards_list_spec.js
@@ -0,0 +1,13 @@
+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
diff --git a/spec/javascripts/notes/components/issue_note_body_spec.js b/spec/javascripts/notes/components/issue_note_body_spec.js
new file mode 100644
index 00000000000..1c0d07af644
--- /dev/null
+++ b/spec/javascripts/notes/components/issue_note_body_spec.js
@@ -0,0 +1,17 @@
+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
diff --git a/spec/javascripts/notes/components/issue_note_edited_text_spec.js b/spec/javascripts/notes/components/issue_note_edited_text_spec.js
new file mode 100644
index 00000000000..f7b4c49dfbe
--- /dev/null
+++ b/spec/javascripts/notes/components/issue_note_edited_text_spec.js
@@ -0,0 +1,17 @@
+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
diff --git a/spec/javascripts/notes/components/issue_note_form_spec.js b/spec/javascripts/notes/components/issue_note_form_spec.js
new file mode 100644
index 00000000000..e431598e885
--- /dev/null
+++ b/spec/javascripts/notes/components/issue_note_form_spec.js
@@ -0,0 +1,65 @@
+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
diff --git a/spec/javascripts/notes/components/issue_note_header_spec.js b/spec/javascripts/notes/components/issue_note_header_spec.js
new file mode 100644
index 00000000000..31c65ed7f43
--- /dev/null
+++ b/spec/javascripts/notes/components/issue_note_header_spec.js
@@ -0,0 +1,15 @@
+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
diff --git a/spec/javascripts/notes/components/issue_note_signed_out_widget_spec.js b/spec/javascripts/notes/components/issue_note_signed_out_widget_spec.js
index 1ba202090d9..f7fe500c853 100644
--- a/spec/javascripts/notes/components/issue_note_signed_out_widget_spec.js
+++ b/spec/javascripts/notes/components/issue_note_signed_out_widget_spec.js
@@ -1,4 +1,4 @@
-describe('issue note signed out widget component', () => {
+describe('issue_note_signed_out_widget component', () => {
it('should render sign in link provided in the store', () => {
});
diff --git a/spec/javascripts/notes/components/issue_note_spec.js b/spec/javascripts/notes/components/issue_note_spec.js
new file mode 100644
index 00000000000..6ec81a5f592
--- /dev/null
+++ b/spec/javascripts/notes/components/issue_note_spec.js
@@ -0,0 +1,17 @@
+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
diff --git a/spec/javascripts/notes/stores/actions_spec.js b/spec/javascripts/notes/stores/actions_spec.js
new file mode 100644
index 00000000000..18b1c2c8f6f
--- /dev/null
+++ b/spec/javascripts/notes/stores/actions_spec.js
@@ -0,0 +1,96 @@
+
+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', () => {
+ });
+ });
+});
diff --git a/spec/javascripts/notes/stores/getters_spec.js b/spec/javascripts/notes/stores/getters_spec.js
new file mode 100644
index 00000000000..ad8fc97362a
--- /dev/null
+++ b/spec/javascripts/notes/stores/getters_spec.js
@@ -0,0 +1,70 @@
+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', () => {
+
+ });
+ });
+});
diff --git a/spec/javascripts/notes/stores/mutation_spec.js b/spec/javascripts/notes/stores/mutation_spec.js
new file mode 100644
index 00000000000..0fdba840f2e
--- /dev/null
+++ b/spec/javascripts/notes/stores/mutation_spec.js
@@ -0,0 +1,99 @@
+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', () => {
+
+ });
+ });
+});