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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
b63a9d10
Commit
b63a9d10
authored
Nov 23, 2020
by
Florie Guibert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Boards refactor - Stop using ListIssue model
Remove ListIssue model from VueX state for GraphQL boards
parent
a8993d30
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
65 additions
and
81 deletions
+65
-81
app/assets/javascripts/boards/boards_util.js
app/assets/javascripts/boards/boards_util.js
+22
-14
app/assets/javascripts/boards/components/issue_card_inner.vue
...assets/javascripts/boards/components/issue_card_inner.vue
+12
-4
ee/spec/frontend/boards/mock_data.js
ee/spec/frontend/boards/mock_data.js
+2
-8
ee/spec/frontend/boards/stores/actions_spec.js
ee/spec/frontend/boards/stores/actions_spec.js
+6
-7
ee/spec/frontend/boards/stores/mutations_spec.js
ee/spec/frontend/boards/stores/mutations_spec.js
+10
-18
spec/frontend/boards/board_list_new_spec.js
spec/frontend/boards/board_list_new_spec.js
+2
-4
spec/frontend/boards/mock_data.js
spec/frontend/boards/mock_data.js
+0
-6
spec/frontend/boards/stores/actions_spec.js
spec/frontend/boards/stores/actions_spec.js
+6
-7
spec/frontend/boards/stores/mutations_spec.js
spec/frontend/boards/stores/mutations_spec.js
+5
-13
No files found.
app/assets/javascripts/boards/boards_util.js
View file @
b63a9d10
import
{
sortBy
}
from
'
lodash
'
;
import
{
sortBy
}
from
'
lodash
'
;
import
ListIssue
from
'
ee_else_ce/boards/models/issue
'
;
import
{
ListType
}
from
'
./constants
'
;
import
{
ListType
}
from
'
./constants
'
;
import
{
getIdFromGraphQLId
}
from
'
~/graphql_shared/utils
'
;
import
{
getIdFromGraphQLId
}
from
'
~/graphql_shared/utils
'
;
import
boardsStore
from
'
~/boards/stores/boards_store
'
;
import
boardsStore
from
'
~/boards/stores/boards_store
'
;
...
@@ -21,11 +20,11 @@ export function formatBoardLists(lists) {
...
@@ -21,11 +20,11 @@ export function formatBoardLists(lists) {
}
}
export
function
formatIssue
(
issue
)
{
export
function
formatIssue
(
issue
)
{
return
new
ListIssue
(
{
return
{
...
issue
,
...
issue
,
labels
:
issue
.
labels
?.
nodes
||
[],
labels
:
issue
.
labels
?.
nodes
||
[],
assignees
:
issue
.
assignees
?.
nodes
||
[],
assignees
:
issue
.
assignees
?.
nodes
||
[],
}
)
;
};
}
}
export
function
formatListIssues
(
listIssues
)
{
export
function
formatListIssues
(
listIssues
)
{
...
@@ -44,12 +43,12 @@ export function formatListIssues(listIssues) {
...
@@ -44,12 +43,12 @@ export function formatListIssues(listIssues) {
[
list
.
id
]:
sortedIssues
.
map
(
i
=>
{
[
list
.
id
]:
sortedIssues
.
map
(
i
=>
{
const
id
=
getIdFromGraphQLId
(
i
.
id
);
const
id
=
getIdFromGraphQLId
(
i
.
id
);
const
listIssue
=
new
ListIssue
(
{
const
listIssue
=
{
...
i
,
...
i
,
id
,
id
,
labels
:
i
.
labels
?.
nodes
||
[],
labels
:
i
.
labels
?.
nodes
||
[],
assignees
:
i
.
assignees
?.
nodes
||
[],
assignees
:
i
.
assignees
?.
nodes
||
[],
}
)
;
};
issues
[
id
]
=
listIssue
;
issues
[
id
]
=
listIssue
;
...
@@ -83,21 +82,30 @@ export function fullLabelId(label) {
...
@@ -83,21 +82,30 @@ export function fullLabelId(label) {
}
}
export
function
moveIssueListHelper
(
issue
,
fromList
,
toList
)
{
export
function
moveIssueListHelper
(
issue
,
fromList
,
toList
)
{
if
(
toList
.
type
===
ListType
.
label
)
{
const
updatedIssue
=
issue
;
issue
.
addLabel
(
toList
.
label
);
if
(
toList
.
type
===
ListType
.
label
&&
!
updatedIssue
.
labels
.
find
(
label
=>
label
.
id
===
toList
.
label
.
id
)
)
{
updatedIssue
.
labels
.
push
(
toList
.
label
);
}
}
if
(
fromList
&&
fromList
.
type
===
ListType
.
label
)
{
if
(
fromList
?.
label
&&
fromList
.
type
===
ListType
.
label
)
{
issue
.
removeLabel
(
fromList
.
label
);
updatedIssue
.
labels
=
updatedIssue
.
labels
.
filter
(
label
=>
fromList
.
label
.
id
!==
label
.
id
);
}
}
if
(
toList
.
type
===
ListType
.
assignee
)
{
if
(
issue
.
addAssignee
(
toList
.
assignee
);
toList
.
type
===
ListType
.
assignee
&&
!
updatedIssue
.
assignees
.
find
(
assignee
=>
assignee
.
id
===
toList
.
assignee
.
id
)
)
{
updatedIssue
.
assignees
.
push
(
toList
.
assignee
);
}
}
if
(
fromList
&&
fromList
.
type
===
ListType
.
assignee
)
{
if
(
fromList
?.
assignee
&&
fromList
.
type
===
ListType
.
assignee
)
{
issue
.
removeAssignee
(
fromList
.
assignee
);
updatedIssue
.
assignees
=
updatedIssue
.
assignees
.
filter
(
assignee
=>
assignee
.
id
!==
fromList
.
assignee
.
id
,
);
}
}
return
i
ssue
;
return
updatedI
ssue
;
}
}
export
default
{
export
default
{
...
...
app/assets/javascripts/boards/components/issue_card_inner.vue
View file @
b63a9d10
...
@@ -158,9 +158,13 @@ export default {
...
@@ -158,9 +158,13 @@ export default {
class=
"confidential-icon gl-mr-2"
class=
"confidential-icon gl-mr-2"
:aria-label=
"__('Confidential')"
:aria-label=
"__('Confidential')"
/>
/>
<a
:href=
"issue.path"
:title=
"issue.title"
class=
"js-no-trigger"
@
mousemove
.
stop
>
{{
<a
issue
.
title
:href=
"issue.path || issue.webUrl || ''"
}}
</a>
:title=
"issue.title"
class=
"js-no-trigger"
@
mousemove
.
stop
>
{{
issue
.
title
}}
</a
>
</h4>
</h4>
</div>
</div>
<div
v-if=
"showLabelFooter"
class=
"board-card-labels gl-mt-2 gl-display-flex gl-flex-wrap"
>
<div
v-if=
"showLabelFooter"
class=
"board-card-labels gl-mt-2 gl-display-flex gl-flex-wrap"
>
...
@@ -196,7 +200,11 @@ export default {
...
@@ -196,7 +200,11 @@ export default {
#{{ issue.iid }}
#{{ issue.iid }}
</span>
</span>
<span
class=
"board-info-items gl-mt-3 gl-display-inline-block"
>
<span
class=
"board-info-items gl-mt-3 gl-display-inline-block"
>
<issue-due-date
v-if=
"issue.dueDate"
:date=
"issue.dueDate"
:closed=
"issue.closed"
/>
<issue-due-date
v-if=
"issue.dueDate"
:date=
"issue.dueDate"
:closed=
"issue.closed || Boolean(issue.closedAt)"
/>
<issue-time-estimate
v-if=
"issue.timeEstimate"
:estimate=
"issue.timeEstimate"
/>
<issue-time-estimate
v-if=
"issue.timeEstimate"
:estimate=
"issue.timeEstimate"
/>
<issue-card-weight
<issue-card-weight
v-if=
"validIssueWeight"
v-if=
"validIssueWeight"
...
...
ee/spec/frontend/boards/mock_data.js
View file @
b63a9d10
/* global ListIssue */
/* global List */
/* global List */
import
Vue
from
'
vue
'
;
import
Vue
from
'
vue
'
;
import
'
~/boards/models/list
'
;
import
'
~/boards/models/list
'
;
import
'
~/boards/models/issue
'
;
export
const
mockLists
=
[
export
const
mockLists
=
[
{
{
...
@@ -95,7 +93,7 @@ export const rawIssue = {
...
@@ -95,7 +93,7 @@ export const rawIssue = {
};
};
export
const
mockIssue
=
{
export
const
mockIssue
=
{
id
:
'
gid://gitlab/Issue/
436
'
,
id
:
'
436
'
,
iid
:
27
,
iid
:
27
,
title
:
'
Issue 1
'
,
title
:
'
Issue 1
'
,
referencePath
:
'
#27
'
,
referencePath
:
'
#27
'
,
...
@@ -111,10 +109,8 @@ export const mockIssue = {
...
@@ -111,10 +109,8 @@ export const mockIssue = {
},
},
};
};
export
const
mockIssueWithModel
=
new
ListIssue
({
...
mockIssue
,
id
:
'
436
'
});
export
const
mockIssue2
=
{
export
const
mockIssue2
=
{
id
:
'
gid://gitlab/Issue/
437
'
,
id
:
'
437
'
,
iid
:
28
,
iid
:
28
,
title
:
'
Issue 2
'
,
title
:
'
Issue 2
'
,
referencePath
:
'
#28
'
,
referencePath
:
'
#28
'
,
...
@@ -130,8 +126,6 @@ export const mockIssue2 = {
...
@@ -130,8 +126,6 @@ export const mockIssue2 = {
},
},
};
};
export
const
mockIssue2WithModel
=
new
ListIssue
({
...
mockIssue2
,
id
:
'
437
'
});
export
const
mockIssue3
=
{
export
const
mockIssue3
=
{
id
:
'
gid://gitlab/Issue/438
'
,
id
:
'
gid://gitlab/Issue/438
'
,
iid
:
29
,
iid
:
29
,
...
...
ee/spec/frontend/boards/stores/actions_spec.js
View file @
b63a9d10
...
@@ -14,10 +14,9 @@ import { mergeUrlParams, removeParams } from '~/lib/utils/url_utility';
...
@@ -14,10 +14,9 @@ import { mergeUrlParams, removeParams } from '~/lib/utils/url_utility';
import
{
import
{
mockLists
,
mockLists
,
mockIssue
,
mockIssue
,
mockIssue2
,
mockEpic
,
mockEpic
,
rawIssue
,
rawIssue
,
mockIssueWithModel
,
mockIssue2WithModel
,
mockListsWithModel
,
mockListsWithModel
,
}
from
'
../mock_data
'
;
}
from
'
../mock_data
'
;
...
@@ -635,8 +634,8 @@ describe('moveIssue', () => {
...
@@ -635,8 +634,8 @@ describe('moveIssue', () => {
};
};
const
issues
=
{
const
issues
=
{
'
436
'
:
mockIssue
WithModel
,
'
436
'
:
mockIssue
,
'
437
'
:
mockIssue2
WithModel
,
'
437
'
:
mockIssue2
,
};
};
const
state
=
{
const
state
=
{
...
@@ -673,7 +672,7 @@ describe('moveIssue', () => {
...
@@ -673,7 +672,7 @@ describe('moveIssue', () => {
{
{
type
:
types
.
MOVE_ISSUE
,
type
:
types
.
MOVE_ISSUE
,
payload
:
{
payload
:
{
originalIssue
:
mockIssue
WithModel
,
originalIssue
:
mockIssue
,
fromListId
:
'
gid://gitlab/List/1
'
,
fromListId
:
'
gid://gitlab/List/1
'
,
toListId
:
'
gid://gitlab/List/2
'
,
toListId
:
'
gid://gitlab/List/2
'
,
epicId
,
epicId
,
...
@@ -714,7 +713,7 @@ describe('moveIssue', () => {
...
@@ -714,7 +713,7 @@ describe('moveIssue', () => {
{
{
type
:
types
.
MOVE_ISSUE
,
type
:
types
.
MOVE_ISSUE
,
payload
:
{
payload
:
{
originalIssue
:
mockIssue
WithModel
,
originalIssue
:
mockIssue
,
fromListId
:
'
gid://gitlab/List/1
'
,
fromListId
:
'
gid://gitlab/List/1
'
,
toListId
:
'
gid://gitlab/List/2
'
,
toListId
:
'
gid://gitlab/List/2
'
,
epicId
,
epicId
,
...
@@ -723,7 +722,7 @@ describe('moveIssue', () => {
...
@@ -723,7 +722,7 @@ describe('moveIssue', () => {
{
{
type
:
types
.
MOVE_ISSUE_FAILURE
,
type
:
types
.
MOVE_ISSUE_FAILURE
,
payload
:
{
payload
:
{
originalIssue
:
mockIssue
WithModel
,
originalIssue
:
mockIssue
,
fromListId
:
'
gid://gitlab/List/1
'
,
fromListId
:
'
gid://gitlab/List/1
'
,
toListId
:
'
gid://gitlab/List/2
'
,
toListId
:
'
gid://gitlab/List/2
'
,
originalIndex
:
0
,
originalIndex
:
0
,
...
...
ee/spec/frontend/boards/stores/mutations_spec.js
View file @
b63a9d10
import
mutations
from
'
ee/boards/stores/mutations
'
;
import
mutations
from
'
ee/boards/stores/mutations
'
;
import
{
import
{
mockIssue
,
mockIssue2
,
mockEpics
,
mockEpic
,
mockListsWithModel
}
from
'
../mock_data
'
;
mockIssue
,
mockIssue2
,
mockEpics
,
mockEpic
,
mockListsWithModel
,
mockIssueWithModel
,
mockIssue2WithModel
,
}
from
'
../mock_data
'
;
const
expectNotImplemented
=
action
=>
{
const
expectNotImplemented
=
action
=>
{
it
(
'
is not implemented
'
,
()
=>
{
it
(
'
is not implemented
'
,
()
=>
{
...
@@ -280,13 +272,13 @@ describe('RESET_EPICS', () => {
...
@@ -280,13 +272,13 @@ describe('RESET_EPICS', () => {
describe
(
'
MOVE_ISSUE
'
,
()
=>
{
describe
(
'
MOVE_ISSUE
'
,
()
=>
{
beforeEach
(()
=>
{
beforeEach
(()
=>
{
const
listIssues
=
{
const
listIssues
=
{
'
gid://gitlab/List/1
'
:
[
mock
ListsWithModel
.
id
,
mockIssue2WithModel
.
id
],
'
gid://gitlab/List/1
'
:
[
mock
Issue
.
id
,
mockIssue2
.
id
],
'
gid://gitlab/List/2
'
:
[],
'
gid://gitlab/List/2
'
:
[],
};
};
const
issues
=
{
const
issues
=
{
'
436
'
:
mockIssue
WithModel
,
'
436
'
:
mockIssue
,
'
437
'
:
mockIssue2
WithModel
,
'
437
'
:
mockIssue2
,
};
};
state
=
{
state
=
{
...
@@ -300,15 +292,15 @@ describe('MOVE_ISSUE', () => {
...
@@ -300,15 +292,15 @@ describe('MOVE_ISSUE', () => {
expect
(
state
.
issues
[
'
437
'
].
epic
.
id
).
toEqual
(
'
gid://gitlab/Epic/40
'
);
expect
(
state
.
issues
[
'
437
'
].
epic
.
id
).
toEqual
(
'
gid://gitlab/Epic/40
'
);
mutations
.
MOVE_ISSUE
(
state
,
{
mutations
.
MOVE_ISSUE
(
state
,
{
originalIssue
:
mockIssue2
WithModel
,
originalIssue
:
mockIssue2
,
fromListId
:
'
gid://gitlab/List/1
'
,
fromListId
:
'
gid://gitlab/List/1
'
,
toListId
:
'
gid://gitlab/List/2
'
,
toListId
:
'
gid://gitlab/List/2
'
,
epicId
,
epicId
,
});
});
const
updatedListIssues
=
{
const
updatedListIssues
=
{
'
gid://gitlab/List/1
'
:
[
mock
ListsWithModel
.
id
],
'
gid://gitlab/List/1
'
:
[
mock
Issue
.
id
],
'
gid://gitlab/List/2
'
:
[
mockIssue2
WithModel
.
id
],
'
gid://gitlab/List/2
'
:
[
mockIssue2
.
id
],
};
};
expect
(
state
.
issuesByListId
).
toEqual
(
updatedListIssues
);
expect
(
state
.
issuesByListId
).
toEqual
(
updatedListIssues
);
...
@@ -319,15 +311,15 @@ describe('MOVE_ISSUE', () => {
...
@@ -319,15 +311,15 @@ describe('MOVE_ISSUE', () => {
expect
(
state
.
issues
[
'
437
'
].
epic
.
id
).
toEqual
(
'
gid://gitlab/Epic/40
'
);
expect
(
state
.
issues
[
'
437
'
].
epic
.
id
).
toEqual
(
'
gid://gitlab/Epic/40
'
);
mutations
.
MOVE_ISSUE
(
state
,
{
mutations
.
MOVE_ISSUE
(
state
,
{
originalIssue
:
mockIssue2
WithModel
,
originalIssue
:
mockIssue2
,
fromListId
:
'
gid://gitlab/List/1
'
,
fromListId
:
'
gid://gitlab/List/1
'
,
toListId
:
'
gid://gitlab/List/2
'
,
toListId
:
'
gid://gitlab/List/2
'
,
epicId
:
null
,
epicId
:
null
,
});
});
const
updatedListIssues
=
{
const
updatedListIssues
=
{
'
gid://gitlab/List/1
'
:
[
mock
ListsWithModel
.
id
],
'
gid://gitlab/List/1
'
:
[
mock
Issue
.
id
],
'
gid://gitlab/List/2
'
:
[
mockIssue2
WithModel
.
id
],
'
gid://gitlab/List/2
'
:
[
mockIssue2
.
id
],
};
};
expect
(
state
.
issuesByListId
).
toEqual
(
updatedListIssues
);
expect
(
state
.
issuesByListId
).
toEqual
(
updatedListIssues
);
...
...
spec/frontend/boards/board_list_new_spec.js
View file @
b63a9d10
/* global List */
/* global List */
/* global ListIssue */
import
Vuex
from
'
vuex
'
;
import
Vuex
from
'
vuex
'
;
import
{
useFakeRequestAnimationFrame
}
from
'
helpers/fake_request_animation_frame
'
;
import
{
useFakeRequestAnimationFrame
}
from
'
helpers/fake_request_animation_frame
'
;
...
@@ -7,7 +6,6 @@ import { createLocalVue, mount } from '@vue/test-utils';
...
@@ -7,7 +6,6 @@ import { createLocalVue, mount } from '@vue/test-utils';
import
eventHub
from
'
~/boards/eventhub
'
;
import
eventHub
from
'
~/boards/eventhub
'
;
import
BoardList
from
'
~/boards/components/board_list_new.vue
'
;
import
BoardList
from
'
~/boards/components/board_list_new.vue
'
;
import
BoardCard
from
'
~/boards/components/board_card.vue
'
;
import
BoardCard
from
'
~/boards/components/board_card.vue
'
;
import
'
~/boards/models/issue
'
;
import
'
~/boards/models/list
'
;
import
'
~/boards/models/list
'
;
import
{
listObj
,
mockIssuesByListId
,
issues
,
mockIssues
}
from
'
./mock_data
'
;
import
{
listObj
,
mockIssuesByListId
,
issues
,
mockIssues
}
from
'
./mock_data
'
;
import
defaultState
from
'
~/boards/stores/state
'
;
import
defaultState
from
'
~/boards/stores/state
'
;
...
@@ -52,7 +50,7 @@ const createComponent = ({
...
@@ -52,7 +50,7 @@ const createComponent = ({
...
listProps
,
...
listProps
,
doNotFetchIssues
:
true
,
doNotFetchIssues
:
true
,
});
});
const
issue
=
new
ListIssue
(
{
const
issue
=
{
title
:
'
Testing
'
,
title
:
'
Testing
'
,
id
:
1
,
id
:
1
,
iid
:
1
,
iid
:
1
,
...
@@ -60,7 +58,7 @@ const createComponent = ({
...
@@ -60,7 +58,7 @@ const createComponent = ({
labels
:
[],
labels
:
[],
assignees
:
[],
assignees
:
[],
...
listIssueProps
,
...
listIssueProps
,
}
)
;
};
if
(
!
Object
.
prototype
.
hasOwnProperty
.
call
(
listProps
,
'
issuesSize
'
))
{
if
(
!
Object
.
prototype
.
hasOwnProperty
.
call
(
listProps
,
'
issuesSize
'
))
{
list
.
issuesSize
=
1
;
list
.
issuesSize
=
1
;
}
}
...
...
spec/frontend/boards/mock_data.js
View file @
b63a9d10
/* global ListIssue */
/* global List */
/* global List */
import
Vue
from
'
vue
'
;
import
Vue
from
'
vue
'
;
import
{
keyBy
}
from
'
lodash
'
;
import
{
keyBy
}
from
'
lodash
'
;
import
'
~/boards/models/list
'
;
import
'
~/boards/models/list
'
;
import
'
~/boards/models/issue
'
;
import
boardsStore
from
'
~/boards/stores/boards_store
'
;
import
boardsStore
from
'
~/boards/stores/boards_store
'
;
export
const
boardObj
=
{
export
const
boardObj
=
{
...
@@ -184,8 +182,6 @@ export const mockActiveIssue = {
...
@@ -184,8 +182,6 @@ export const mockActiveIssue = {
emailsDisabled
:
false
,
emailsDisabled
:
false
,
};
};
export
const
mockIssueWithModel
=
new
ListIssue
(
mockIssue
);
export
const
mockIssue2
=
{
export
const
mockIssue2
=
{
id
:
'
gid://gitlab/Issue/437
'
,
id
:
'
gid://gitlab/Issue/437
'
,
iid
:
28
,
iid
:
28
,
...
@@ -203,8 +199,6 @@ export const mockIssue2 = {
...
@@ -203,8 +199,6 @@ export const mockIssue2 = {
},
},
};
};
export
const
mockIssue2WithModel
=
new
ListIssue
(
mockIssue2
);
export
const
mockIssue3
=
{
export
const
mockIssue3
=
{
id
:
'
gid://gitlab/Issue/438
'
,
id
:
'
gid://gitlab/Issue/438
'
,
iid
:
29
,
iid
:
29
,
...
...
spec/frontend/boards/stores/actions_spec.js
View file @
b63a9d10
...
@@ -4,8 +4,7 @@ import {
...
@@ -4,8 +4,7 @@ import {
mockLists
,
mockLists
,
mockListsById
,
mockListsById
,
mockIssue
,
mockIssue
,
mockIssueWithModel
,
mockIssue2
,
mockIssue2WithModel
,
rawIssue
,
rawIssue
,
mockIssues
,
mockIssues
,
mockMilestone
,
mockMilestone
,
...
@@ -500,8 +499,8 @@ describe('moveIssue', () => {
...
@@ -500,8 +499,8 @@ describe('moveIssue', () => {
};
};
const
issues
=
{
const
issues
=
{
'
436
'
:
mockIssue
WithModel
,
'
436
'
:
mockIssue
,
'
437
'
:
mockIssue2
WithModel
,
'
437
'
:
mockIssue2
,
};
};
const
state
=
{
const
state
=
{
...
@@ -537,7 +536,7 @@ describe('moveIssue', () => {
...
@@ -537,7 +536,7 @@ describe('moveIssue', () => {
{
{
type
:
types
.
MOVE_ISSUE
,
type
:
types
.
MOVE_ISSUE
,
payload
:
{
payload
:
{
originalIssue
:
mockIssue
WithModel
,
originalIssue
:
mockIssue
,
fromListId
:
'
gid://gitlab/List/1
'
,
fromListId
:
'
gid://gitlab/List/1
'
,
toListId
:
'
gid://gitlab/List/2
'
,
toListId
:
'
gid://gitlab/List/2
'
,
},
},
...
@@ -612,7 +611,7 @@ describe('moveIssue', () => {
...
@@ -612,7 +611,7 @@ describe('moveIssue', () => {
{
{
type
:
types
.
MOVE_ISSUE
,
type
:
types
.
MOVE_ISSUE
,
payload
:
{
payload
:
{
originalIssue
:
mockIssue
WithModel
,
originalIssue
:
mockIssue
,
fromListId
:
'
gid://gitlab/List/1
'
,
fromListId
:
'
gid://gitlab/List/1
'
,
toListId
:
'
gid://gitlab/List/2
'
,
toListId
:
'
gid://gitlab/List/2
'
,
},
},
...
@@ -620,7 +619,7 @@ describe('moveIssue', () => {
...
@@ -620,7 +619,7 @@ describe('moveIssue', () => {
{
{
type
:
types
.
MOVE_ISSUE_FAILURE
,
type
:
types
.
MOVE_ISSUE_FAILURE
,
payload
:
{
payload
:
{
originalIssue
:
mockIssue
WithModel
,
originalIssue
:
mockIssue
,
fromListId
:
'
gid://gitlab/List/1
'
,
fromListId
:
'
gid://gitlab/List/1
'
,
toListId
:
'
gid://gitlab/List/2
'
,
toListId
:
'
gid://gitlab/List/2
'
,
originalIndex
:
0
,
originalIndex
:
0
,
...
...
spec/frontend/boards/stores/mutations_spec.js
View file @
b63a9d10
import
mutations
from
'
~/boards/stores/mutations
'
;
import
mutations
from
'
~/boards/stores/mutations
'
;
import
*
as
types
from
'
~/boards/stores/mutation_types
'
;
import
*
as
types
from
'
~/boards/stores/mutation_types
'
;
import
defaultState
from
'
~/boards/stores/state
'
;
import
defaultState
from
'
~/boards/stores/state
'
;
import
{
import
{
mockListsWithModel
,
mockLists
,
rawIssue
,
mockIssue
,
mockIssue2
}
from
'
../mock_data
'
;
mockListsWithModel
,
mockLists
,
rawIssue
,
mockIssue
,
mockIssue2
,
mockIssueWithModel
,
mockIssue2WithModel
,
}
from
'
../mock_data
'
;
const
expectNotImplemented
=
action
=>
{
const
expectNotImplemented
=
action
=>
{
it
(
'
is not implemented
'
,
()
=>
{
it
(
'
is not implemented
'
,
()
=>
{
...
@@ -355,8 +347,8 @@ describe('Board Store Mutations', () => {
...
@@ -355,8 +347,8 @@ describe('Board Store Mutations', () => {
};
};
const
issues
=
{
const
issues
=
{
'
1
'
:
mockIssue
WithModel
,
'
1
'
:
mockIssue
,
'
2
'
:
mockIssue2
WithModel
,
'
2
'
:
mockIssue2
,
};
};
state
=
{
state
=
{
...
@@ -367,7 +359,7 @@ describe('Board Store Mutations', () => {
...
@@ -367,7 +359,7 @@ describe('Board Store Mutations', () => {
};
};
mutations
.
MOVE_ISSUE
(
state
,
{
mutations
.
MOVE_ISSUE
(
state
,
{
originalIssue
:
mockIssue2
WithModel
,
originalIssue
:
mockIssue2
,
fromListId
:
'
gid://gitlab/List/1
'
,
fromListId
:
'
gid://gitlab/List/1
'
,
toListId
:
'
gid://gitlab/List/2
'
,
toListId
:
'
gid://gitlab/List/2
'
,
});
});
...
@@ -396,7 +388,7 @@ describe('Board Store Mutations', () => {
...
@@ -396,7 +388,7 @@ describe('Board Store Mutations', () => {
issue
:
rawIssue
,
issue
:
rawIssue
,
});
});
expect
(
state
.
issues
).
toEqual
({
'
436
'
:
{
...
mockIssue
WithModel
,
id
:
436
}
});
expect
(
state
.
issues
).
toEqual
({
'
436
'
:
{
...
mockIssue
,
id
:
436
}
});
});
});
});
});
...
...
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