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
Boxiang Sun
gitlab-ce
Commits
c7dbba8b
Commit
c7dbba8b
authored
Aug 11, 2017
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds tests for sync actions
parent
8b01ef82
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
83 deletions
+2
-83
spec/javascripts/notes/stores/actions_spec.js
spec/javascripts/notes/stores/actions_spec.js
+2
-83
No files found.
spec/javascripts/notes/stores/actions_spec.js
View file @
c7dbba8b
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
'
,
()
=>
{
});
});
});
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