[ci skip] Adds tests cases

This commit is contained in:
Filipa Lacerda 2017-08-04 16:51:35 +01:00
parent 08b76721f3
commit 1c1fef7af3
15 changed files with 613 additions and 1 deletions

View file

@ -94,6 +94,8 @@
this.setLastFetchedAt(this.getNotesDataByProp('lastFetchedAt'));
this.poll();
debugger;
},
checkLocationHash() {
const hash = gl.utils.getLocationHash();

View file

@ -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', () => {
});
});
});

View file

@ -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', () => {
});
});
});
});

View file

@ -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', () => {
});
});
});

View file

@ -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', () => {
});
});
});

View file

@ -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', () => {
});
});

View file

@ -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', () => {
});
});

View file

@ -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', () => {
});
});

View file

@ -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', () => {
});
});
});
});

View file

@ -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', () => {
});
});
});

View file

@ -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', () => {
});

View file

@ -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', () => {
});
});

View file

@ -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', () => {
});
});
});

View file

@ -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', () => {
});
});
});

View file

@ -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', () => {
});
});
});