summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2018-06-05 09:50:48 +0100
committerPhil Hughes <me@iamphill.com>2018-06-06 11:19:29 +0100
commit95b3ff056fb9edabef6c512c5de353c5c4a8bcb3 (patch)
tree3799f570c040f558c0281be10f5d8cc6a6b9758e /spec
parentf8d8b63f32176975c802313d966fb81c2bb2122a (diff)
downloadgitlab-ce-95b3ff056fb9edabef6c512c5de353c5c4a8bcb3.tar.gz
fixed mutations spec
Diffstat (limited to 'spec')
-rw-r--r--spec/javascripts/ide/stores/modules/merge_requests/mutations_spec.js19
1 files changed, 11 insertions, 8 deletions
diff --git a/spec/javascripts/ide/stores/modules/merge_requests/mutations_spec.js b/spec/javascripts/ide/stores/modules/merge_requests/mutations_spec.js
index 664d3914564..ea03131d90d 100644
--- a/spec/javascripts/ide/stores/modules/merge_requests/mutations_spec.js
+++ b/spec/javascripts/ide/stores/modules/merge_requests/mutations_spec.js
@@ -12,26 +12,29 @@ describe('IDE merge requests mutations', () => {
describe(types.REQUEST_MERGE_REQUESTS, () => {
it('sets loading to true', () => {
- mutations[types.REQUEST_MERGE_REQUESTS](mockedState);
+ mutations[types.REQUEST_MERGE_REQUESTS](mockedState, 'created');
- expect(mockedState.isLoading).toBe(true);
+ expect(mockedState.created.isLoading).toBe(true);
});
});
describe(types.RECEIVE_MERGE_REQUESTS_ERROR, () => {
it('sets loading to false', () => {
- mutations[types.RECEIVE_MERGE_REQUESTS_ERROR](mockedState);
+ mutations[types.RECEIVE_MERGE_REQUESTS_ERROR](mockedState, 'created');
- expect(mockedState.isLoading).toBe(false);
+ expect(mockedState.created.isLoading).toBe(false);
});
});
describe(types.RECEIVE_MERGE_REQUESTS_SUCCESS, () => {
it('sets merge requests', () => {
gon.gitlab_url = gl.TEST_HOST;
- mutations[types.RECEIVE_MERGE_REQUESTS_SUCCESS](mockedState, mergeRequests);
+ mutations[types.RECEIVE_MERGE_REQUESTS_SUCCESS](mockedState, {
+ type: 'created',
+ data: mergeRequests,
+ });
- expect(mockedState.mergeRequests).toEqual([
+ expect(mockedState.created.mergeRequests).toEqual([
{
id: 1,
iid: 1,
@@ -47,9 +50,9 @@ describe('IDE merge requests mutations', () => {
it('clears merge request array', () => {
mockedState.mergeRequests = ['test'];
- mutations[types.RESET_MERGE_REQUESTS](mockedState);
+ mutations[types.RESET_MERGE_REQUESTS](mockedState, 'created');
- expect(mockedState.mergeRequests).toEqual([]);
+ expect(mockedState.created.mergeRequests).toEqual([]);
});
});
});