diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2017-08-11 21:15:33 +0100 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2017-08-11 21:15:33 +0100 |
commit | c7dbba8bf1e87bb69656ce7a99fb10633d6c78da (patch) | |
tree | 68ce47ab49322c25413be1a83db74985fe6d3080 | |
parent | 8b01ef826df97fa23db657ba5826cb0dd0d0b38f (diff) | |
download | gitlab-ce-c7dbba8bf1e87bb69656ce7a99fb10633d6c78da.tar.gz |
Adds tests for sync actions
-rw-r--r-- | spec/javascripts/notes/stores/actions_spec.js | 85 |
1 files changed, 2 insertions, 83 deletions
diff --git a/spec/javascripts/notes/stores/actions_spec.js b/spec/javascripts/notes/stores/actions_spec.js index be304893a74..68b71f14bd6 100644 --- a/spec/javascripts/notes/stores/actions_spec.js +++ b/spec/javascripts/notes/stores/actions_spec.js @@ -1,25 +1,9 @@ import * as actions from '~/notes/stores/actions'; import testAction from './helpers'; -import { note, discussionMock, notesDataMock, userDataMock, issueDataMock, individualNote } from '../mock_data'; -import service from '~/notes/services/issue_notes_service'; +import { discussionMock, notesDataMock, userDataMock, issueDataMock, individualNote } from '../mock_data'; -// use require syntax for inline loaders. -// with inject-loader, this returns a module factory -// that allows us to inject mocked dependencies. -// const actionsInjector = require('inject-loader!./actions'); - -// const actions = actionsInjector({ -// '../api/shop': { -// getProducts (cb) { -// setTimeout(() => { -// cb([ /* mocked response */ ]) -// }, 100) -// } -// } -// }); - -fdescribe('Actions Notes Store', () => { +describe('Actions Notes Store', () => { describe('setNotesData', () => { it('should set received notes data', (done) => { testAction(actions.setNotesData, null, { notesData: {} }, [ @@ -75,69 +59,4 @@ fdescribe('Actions Notes Store', () => { ], done); }); }); - - describe('fetchNotes', () => { - it('should request notes', (done) => { - spyOn(service, 'fetchNotes').and.returnValue(Promise.resolve({ - json() { - return [individualNote]; - }, - })); - testAction(actions.fetchNotes, null, { notes: [] }, [ - { type: 'TOGGLE_DISCUSSION', payload: [individualNote] }, - ], done); - }); - }); - - 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', () => { - }); - }); }); |