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
06212e0c
Commit
06212e0c
authored
Jul 24, 2020
by
Scott Stern
Committed by
Andrew Fontaine
Jul 24, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename listid to id for generalization of sidebar mechanism
parent
a8d7c5d4
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
71 additions
and
75 deletions
+71
-75
app/assets/javascripts/boards/constants.js
app/assets/javascripts/boards/constants.js
+1
-1
app/assets/javascripts/boards/stores/state.js
app/assets/javascripts/boards/stores/state.js
+2
-2
ee/app/assets/javascripts/boards/components/board_list_header.vue
...ssets/javascripts/boards/components/board_list_header.vue
+5
-5
ee/app/assets/javascripts/boards/components/board_settings_sidebar.vue
.../javascripts/boards/components/board_settings_sidebar.vue
+14
-14
ee/app/assets/javascripts/boards/stores/actions.js
ee/app/assets/javascripts/boards/stores/actions.js
+3
-3
ee/app/assets/javascripts/boards/stores/mutations.js
ee/app/assets/javascripts/boards/stores/mutations.js
+1
-1
ee/spec/frontend/boards/components/board_list_header_spec.js
ee/spec/frontend/boards/components/board_list_header_spec.js
+3
-3
ee/spec/frontend/boards/components/board_settings_sidebar_spec.js
...frontend/boards/components/board_settings_sidebar_spec.js
+32
-36
ee/spec/frontend/boards/stores/actions_spec.js
ee/spec/frontend/boards/stores/actions_spec.js
+7
-7
ee/spec/frontend/boards/stores/mutations_spec.js
ee/spec/frontend/boards/stores/mutations_spec.js
+3
-3
No files found.
app/assets/javascripts/boards/constants.js
View file @
06212e0c
...
...
@@ -13,7 +13,7 @@ export const ListType = {
blank
:
'
blank
'
,
};
export
const
inactive
List
Id
=
0
;
export
const
inactiveId
=
0
;
export
default
{
BoardType
,
...
...
app/assets/javascripts/boards/stores/state.js
View file @
06212e0c
import
{
inactive
List
Id
}
from
'
~/boards/constants
'
;
import
{
inactiveId
}
from
'
~/boards/constants
'
;
export
default
()
=>
({
endpoints
:
{},
isShowingLabels
:
true
,
active
ListId
:
inactiveList
Id
,
active
Id
:
inactive
Id
,
});
ee/app/assets/javascripts/boards/components/board_list_header.vue
View file @
06212e0c
...
...
@@ -3,7 +3,7 @@ import { mapState, mapActions } from 'vuex';
import
BoardListHeaderFoss
from
'
~/boards/components/board_list_header.vue
'
;
import
{
__
,
sprintf
,
s__
}
from
'
~/locale
'
;
import
boardsStore
from
'
~/boards/stores/boards_store
'
;
import
{
inactive
List
Id
}
from
'
~/boards/constants
'
;
import
{
inactiveId
}
from
'
~/boards/constants
'
;
import
eventHub
from
'
~/sidebar/event_hub
'
;
export
default
{
...
...
@@ -14,7 +14,7 @@ export default {
};
},
computed
:
{
...
mapState
([
'
active
List
Id
'
]),
...
mapState
([
'
activeId
'
]),
issuesTooltip
()
{
const
{
issuesSize
,
maxIssueCount
}
=
this
.
list
;
...
...
@@ -39,13 +39,13 @@ export default {
},
},
methods
:
{
...
mapActions
([
'
setActive
List
Id
'
]),
...
mapActions
([
'
setActiveId
'
]),
openSidebarSettings
()
{
if
(
this
.
active
ListId
===
inactiveList
Id
)
{
if
(
this
.
active
Id
===
inactive
Id
)
{
eventHub
.
$emit
(
'
sidebar.closeAll
'
);
}
this
.
setActive
List
Id
(
this
.
list
.
id
);
this
.
setActiveId
(
this
.
list
.
id
);
},
},
};
...
...
ee/app/assets/javascripts/boards/components/board_settings_sidebar.vue
View file @
06212e0c
...
...
@@ -15,7 +15,7 @@ import boardsStoreEE from '../stores/boards_store_ee';
import
eventHub
from
'
~/sidebar/event_hub
'
;
import
flash
from
'
~/flash
'
;
import
{
isScopedLabel
}
from
'
~/lib/utils/common_utils
'
;
import
{
inactive
List
Id
}
from
'
~/boards/constants
'
;
import
{
inactiveId
}
from
'
~/boards/constants
'
;
// NOTE: need to revisit how we handle headerHeight, because we have so many different header and footer options.
export
default
{
...
...
@@ -52,16 +52,16 @@ export default {
};
},
computed
:
{
...
mapState
([
'
active
List
Id
'
]),
...
mapState
([
'
activeId
'
]),
activeList
()
{
/*
Warning: Though a computed property it is not reactive because we are
referencing a List Model class. Reactivity only applies to plain JS objects
*/
return
boardsStoreEE
.
store
.
state
.
lists
.
find
(({
id
})
=>
id
===
this
.
active
List
Id
);
return
boardsStoreEE
.
store
.
state
.
lists
.
find
(({
id
})
=>
id
===
this
.
activeId
);
},
isSidebarOpen
()
{
return
this
.
active
ListId
!==
inactiveList
Id
;
return
this
.
active
Id
!==
inactive
Id
;
},
activeListLabel
()
{
return
this
.
activeList
.
label
;
...
...
@@ -108,10 +108,10 @@ export default {
eventHub
.
$off
(
'
sidebar.closeAll
'
,
this
.
closeSidebar
);
},
methods
:
{
...
mapActions
([
'
setActive
List
Id
'
,
'
updateListWipLimit
'
]),
...
mapActions
([
'
setActiveId
'
,
'
updateListWipLimit
'
]),
closeSidebar
()
{
this
.
edit
=
false
;
this
.
setActive
ListId
(
inactiveList
Id
);
this
.
setActive
Id
(
inactive
Id
);
},
showInput
()
{
this
.
edit
=
true
;
...
...
@@ -128,7 +128,7 @@ export default {
this
.
updating
=
true
;
// need to reassign bc were clearing the ref in resetStateAfterUpdate.
const
wipLimit
=
this
.
currentWipLimit
;
const
id
=
this
.
active
List
Id
;
const
id
=
this
.
activeId
;
this
.
updateListWipLimit
({
maxIssueCount
:
this
.
currentWipLimit
,
id
})
.
then
(()
=>
{
...
...
@@ -137,7 +137,7 @@ export default {
})
.
catch
(()
=>
{
this
.
resetStateAfterUpdate
();
this
.
setActive
ListId
(
inactiveList
Id
);
this
.
setActive
Id
(
inactive
Id
);
flash
(
__
(
'
Something went wrong while updating your list settings
'
));
});
}
else
{
...
...
@@ -145,14 +145,14 @@ export default {
}
},
clearWipLimit
()
{
this
.
updateListWipLimit
({
maxIssueCount
:
0
,
id
:
this
.
active
List
Id
})
this
.
updateListWipLimit
({
maxIssueCount
:
0
,
id
:
this
.
activeId
})
.
then
(()
=>
{
boardsStoreEE
.
setMaxIssueCountOnList
(
this
.
active
List
Id
,
0
);
boardsStoreEE
.
setMaxIssueCountOnList
(
this
.
activeId
,
0
);
this
.
resetStateAfterUpdate
();
})
.
catch
(()
=>
{
this
.
resetStateAfterUpdate
();
this
.
setActive
ListId
(
inactiveList
Id
);
this
.
setActive
Id
(
inactive
Id
);
flash
(
__
(
'
Something went wrong while updating your list settings
'
));
});
},
...
...
@@ -202,9 +202,9 @@ export default {
</gl-avatar-link>
</
template
>
<
template
v-else-if=
"boardListType === $options.milestone"
>
<gl-link
class=
"js-milestone"
:href=
"activeListMilestone.webUrl"
>
{{
activeListMilestone
.
title
}}
</gl-link>
<gl-link
class=
"js-milestone"
:href=
"activeListMilestone.webUrl"
>
{{
activeListMilestone
.
title
}}
</gl-link>
</
template
>
</div>
<div
class=
"d-flex justify-content-between flex-column"
>
...
...
ee/app/assets/javascripts/boards/stores/actions.js
View file @
06212e0c
...
...
@@ -67,13 +67,13 @@ export default {
commit
(
types
.
SET_SHOW_LABELS
,
val
);
},
setActive
List
Id
({
commit
},
listId
)
{
setActiveId
({
commit
},
listId
)
{
commit
(
types
.
SET_ACTIVE_LIST_ID
,
listId
);
},
updateListWipLimit
({
state
},
{
maxIssueCount
})
{
const
{
active
List
Id
}
=
state
;
const
{
activeId
}
=
state
;
return
axios
.
put
(
`
${
boardsStoreEE
.
store
.
state
.
endpoints
.
listsEndpoint
}
/
${
active
List
Id
}
`
,
{
return
axios
.
put
(
`
${
boardsStoreEE
.
store
.
state
.
endpoints
.
listsEndpoint
}
/
${
activeId
}
`
,
{
list
:
{
max_issue_count
:
maxIssueCount
,
},
...
...
ee/app/assets/javascripts/boards/stores/mutations.js
View file @
06212e0c
...
...
@@ -12,7 +12,7 @@ export default {
state
.
isShowingLabels
=
val
;
},
[
mutationTypes
.
SET_ACTIVE_LIST_ID
]:
(
state
,
id
)
=>
{
state
.
active
List
Id
=
id
;
state
.
activeId
=
id
;
},
[
mutationTypes
.
REQUEST_AVAILABLE_BOARDS
]:
()
=>
{
...
...
ee/spec/frontend/boards/components/board_list_header_spec.js
View file @
06212e0c
...
...
@@ -5,7 +5,7 @@ import AxiosMockAdapter from 'axios-mock-adapter';
import
BoardListHeader
from
'
ee/boards/components/board_list_header.vue
'
;
import
List
from
'
~/boards/models/list
'
;
import
{
ListType
,
inactive
List
Id
}
from
'
~/boards/constants
'
;
import
{
ListType
,
inactiveId
}
from
'
~/boards/constants
'
;
import
axios
from
'
~/lib/utils/axios_utils
'
;
import
sidebarEventHub
from
'
~/sidebar/event_hub
'
;
...
...
@@ -29,7 +29,7 @@ describe('Board List Header Component', () => {
window
.
gon
=
{};
axiosMock
=
new
AxiosMockAdapter
(
axios
);
axiosMock
.
onGet
(
`
${
TEST_HOST
}
/lists/1/issues`
).
reply
(
200
,
{
issues
:
[]
});
store
=
new
Vuex
.
Store
({
state
:
{
active
ListId
:
inactiveList
Id
}
});
store
=
new
Vuex
.
Store
({
state
:
{
active
Id
:
inactive
Id
}
});
jest
.
spyOn
(
store
,
'
dispatch
'
).
mockImplementation
();
});
...
...
@@ -145,7 +145,7 @@ describe('Board List Header Component', () => {
});
it
(
'
does not emits event when there is an active List
'
,
()
=>
{
store
.
state
.
active
List
Id
=
listObj
.
id
;
store
.
state
.
activeId
=
listObj
.
id
;
createComponent
({
listType
:
hasSettings
[
0
]
});
wrapper
.
vm
.
openSidebarSettings
();
...
...
ee/spec/frontend/boards/components/board_settings_sidebar_spec.js
View file @
06212e0c
...
...
@@ -11,7 +11,7 @@ import bs from '~/boards/stores/boards_store';
import
sidebarEventHub
from
'
~/sidebar/event_hub
'
;
import
flash
from
'
~/flash
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
import
{
inactive
List
Id
}
from
'
~/boards/constants
'
;
import
{
inactiveId
}
from
'
~/boards/constants
'
;
jest
.
mock
(
'
~/flash
'
);
// NOTE: needed for calling boardsStore.addList
...
...
@@ -29,11 +29,7 @@ describe('BoardSettingsSideBar', () => {
const
listId
=
1
;
const
currentWipLimit
=
1
;
// Needs to be other than null to trigger requests.
const
createComponent
=
(
state
=
{
activeListId
:
inactiveListId
},
actions
=
{},
localState
=
{},
)
=>
{
const
createComponent
=
(
state
=
{
activeId
:
inactiveId
},
actions
=
{},
localState
=
{})
=>
{
storeActions
=
actions
;
const
store
=
new
Vuex
.
Store
({
...
...
@@ -93,35 +89,35 @@ describe('BoardSettingsSideBar', () => {
describe
(
'
on close
'
,
()
=>
{
it
(
'
calls closeSidebar
'
,
()
=>
{
const
spy
=
jest
.
fn
();
createComponent
({
active
ListId
:
inactiveListId
},
{
setActiveList
Id
:
spy
});
createComponent
({
active
Id
:
inactiveId
},
{
setActive
Id
:
spy
});
wrapper
.
find
(
GlDrawer
).
vm
.
$emit
(
'
close
'
);
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
expect
(
storeActions
.
setActive
List
Id
).
toHaveBeenCalledWith
(
expect
(
storeActions
.
setActiveId
).
toHaveBeenCalledWith
(
expect
.
anything
(),
inactive
List
Id
,
inactiveId
,
undefined
,
);
});
});
it
(
'
calls closeSidebar on sidebar.closeAll event
'
,
()
=>
{
createComponent
({
active
ListId
:
inactiveListId
},
{
setActiveList
Id
:
jest
.
fn
()
});
createComponent
({
active
Id
:
inactiveId
},
{
setActive
Id
:
jest
.
fn
()
});
sidebarEventHub
.
$emit
(
'
sidebar.closeAll
'
);
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
expect
(
storeActions
.
setActive
List
Id
).
toHaveBeenCalledWith
(
expect
(
storeActions
.
setActiveId
).
toHaveBeenCalledWith
(
expect
.
anything
(),
inactive
List
Id
,
inactiveId
,
undefined
,
);
});
});
});
describe
(
'
when active
List
Id is zero
'
,
()
=>
{
describe
(
'
when activeId is zero
'
,
()
=>
{
it
(
'
renders GlDrawer with open false
'
,
()
=>
{
createComponent
();
...
...
@@ -129,7 +125,7 @@ describe('BoardSettingsSideBar', () => {
});
});
describe
(
'
when active
List
Id is greater than zero
'
,
()
=>
{
describe
(
'
when activeId is greater than zero
'
,
()
=>
{
beforeEach
(()
=>
{
mock
=
new
MockAdapter
(
axios
);
...
...
@@ -145,13 +141,13 @@ describe('BoardSettingsSideBar', () => {
});
it
(
'
renders GlDrawer with open false
'
,
()
=>
{
createComponent
({
active
List
Id
:
1
});
createComponent
({
activeId
:
1
});
expect
(
wrapper
.
find
(
GlDrawer
).
props
(
'
open
'
)).
toBe
(
true
);
});
});
describe
(
'
when active
List
Id is in boardsStore
'
,
()
=>
{
describe
(
'
when activeId is in boardsStore
'
,
()
=>
{
beforeEach
(()
=>
{
mock
=
new
MockAdapter
(
axios
);
...
...
@@ -161,7 +157,7 @@ describe('BoardSettingsSideBar', () => {
list_type
:
'
label
'
,
});
createComponent
({
active
List
Id
:
listId
});
createComponent
({
activeId
:
listId
});
});
afterEach
(()
=>
{
...
...
@@ -177,13 +173,13 @@ describe('BoardSettingsSideBar', () => {
});
});
describe
(
'
when active
List
Id is not in boardsStore
'
,
()
=>
{
describe
(
'
when activeId is not in boardsStore
'
,
()
=>
{
beforeEach
(()
=>
{
mock
=
new
MockAdapter
(
axios
);
boardsStore
.
store
.
addList
({
id
:
listId
,
label
:
{
title
:
labelTitle
,
color
:
labelColor
}
});
createComponent
({
active
ListId
:
inactiveList
Id
});
createComponent
({
active
Id
:
inactive
Id
});
});
afterEach
(()
=>
{
...
...
@@ -216,7 +212,7 @@ describe('BoardSettingsSideBar', () => {
});
it
(
'
renders "None" in the block
'
,
()
=>
{
createComponent
({
active
List
Id
:
listId
});
createComponent
({
activeId
:
listId
});
expect
(
wrapper
.
find
(
'
.js-wip-limit
'
).
text
()).
toMatchSnapshot
();
});
...
...
@@ -242,13 +238,13 @@ describe('BoardSettingsSideBar', () => {
});
it
(
'
renders the correct milestone text
'
,
()
=>
{
createComponent
({
active
List
Id
:
1
});
createComponent
({
activeId
:
1
});
expect
(
wrapper
.
find
(
'
.js-milestone
'
).
text
()).
toMatchSnapshot
();
});
it
(
'
renders the correct list type text
'
,
()
=>
{
createComponent
({
active
List
Id
:
1
});
createComponent
({
activeId
:
1
});
expect
(
wrapper
.
find
(
'
.js-list-label
'
).
text
()).
toMatchSnapshot
();
});
...
...
@@ -270,14 +266,14 @@ describe('BoardSettingsSideBar', () => {
});
it
(
'
renders gl-avatar-link with correct href
'
,
()
=>
{
createComponent
({
active
List
Id
:
1
});
createComponent
({
activeId
:
1
});
expect
(
wrapper
.
find
(
GlAvatarLink
).
exists
()).
toBe
(
true
);
expect
(
wrapper
.
find
(
GlAvatarLink
).
attributes
(
'
href
'
)).
toEqual
(
'
https://gitlab.com/root
'
);
});
it
(
'
renders gl-avatar-labeled with "root" as username and name as "Test"
'
,
()
=>
{
createComponent
({
active
List
Id
:
1
});
createComponent
({
activeId
:
1
});
expect
(
wrapper
.
find
(
GlAvatarLabeled
).
exists
()).
toBe
(
true
);
expect
(
wrapper
.
find
(
GlAvatarLabeled
).
attributes
(
'
label
'
)).
toEqual
(
'
Test
'
);
...
...
@@ -285,7 +281,7 @@ describe('BoardSettingsSideBar', () => {
});
it
(
'
renders the correct list type text
'
,
()
=>
{
createComponent
({
active
List
Id
:
1
});
createComponent
({
activeId
:
1
});
expect
(
wrapper
.
find
(
'
.js-list-label
'
).
text
()).
toMatchSnapshot
();
});
...
...
@@ -303,7 +299,7 @@ describe('BoardSettingsSideBar', () => {
list_type
:
'
label
'
,
});
createComponent
({
active
List
Id
:
num
});
createComponent
({
activeId
:
num
});
expect
(
wrapper
.
find
(
'
.js-wip-limit
'
).
text
()).
toMatchSnapshot
();
});
...
...
@@ -320,7 +316,7 @@ describe('BoardSettingsSideBar', () => {
list_type
:
'
label
'
,
});
createComponent
({
active
List
Id
:
listId
},
{
updateListWipLimit
:
()
=>
{}
});
createComponent
({
activeId
:
listId
},
{
updateListWipLimit
:
()
=>
{}
});
});
it
(
'
renders an input
'
,
()
=>
{
...
...
@@ -364,7 +360,7 @@ describe('BoardSettingsSideBar', () => {
config
:
{
data
:
JSON
.
stringify
({
list
:
{
max_issue_count
:
0
}
})
},
});
createComponent
({
active
List
Id
:
listId
},
{
updateListWipLimit
:
spy
});
createComponent
({
activeId
:
listId
},
{
updateListWipLimit
:
spy
});
});
it
(
'
resets wipLimit to 0
'
,
()
=>
{
...
...
@@ -388,7 +384,7 @@ describe('BoardSettingsSideBar', () => {
list_type
:
'
label
'
,
});
createComponent
({
active
List
Id
:
listId
},
{
updateListWipLimit
:
()
=>
{}
});
createComponent
({
activeId
:
listId
},
{
updateListWipLimit
:
()
=>
{}
});
});
it
(
'
does not render the remove limit button
'
,
()
=>
{
...
...
@@ -425,7 +421,7 @@ describe('BoardSettingsSideBar', () => {
config
:
{
data
:
JSON
.
stringify
({
list
:
{
max_issue_count
:
'
4
'
}
})
},
});
createComponent
(
{
active
List
Id
:
1
},
{
activeId
:
1
},
{
updateListWipLimit
:
spy
},
{
edit
:
true
,
currentWipLimit
},
);
...
...
@@ -441,7 +437,7 @@ describe('BoardSettingsSideBar', () => {
it
(
'
doesnt call updateListWipLimit
'
,
()
=>
{
const
spy
=
jest
.
fn
().
mockResolvedValue
({});
createComponent
(
{
active
List
Id
:
1
},
{
activeId
:
1
},
{
updateListWipLimit
:
spy
},
{
edit
:
true
,
currentWipLimit
:
2
},
);
...
...
@@ -458,7 +454,7 @@ describe('BoardSettingsSideBar', () => {
it
(
'
doesnt call updateListWipLimit
'
,
()
=>
{
const
spy
=
jest
.
fn
().
mockResolvedValue
({});
createComponent
(
{
active
List
Id
:
1
},
{
activeId
:
1
},
{
updateListWipLimit
:
spy
},
{
edit
:
true
,
currentWipLimit
:
null
},
);
...
...
@@ -477,7 +473,7 @@ describe('BoardSettingsSideBar', () => {
beforeEach
(()
=>
{
const
spy
=
jest
.
fn
().
mockResolvedValue
({});
createComponent
(
{
active
List
Id
:
1
},
{
activeId
:
1
},
{
updateListWipLimit
:
spy
},
{
edit
:
true
,
currentWipLimit
:
maxIssueCount
},
);
...
...
@@ -508,8 +504,8 @@ describe('BoardSettingsSideBar', () => {
beforeEach
(()
=>
{
const
spy
=
jest
.
fn
().
mockRejectedValue
();
createComponent
(
{
active
List
Id
:
1
},
{
updateListWipLimit
:
spy
,
setActive
List
Id
:
()
=>
{}
},
{
activeId
:
1
},
{
updateListWipLimit
:
spy
,
setActiveId
:
()
=>
{}
},
{
edit
:
true
,
currentWipLimit
},
);
...
...
@@ -527,7 +523,7 @@ describe('BoardSettingsSideBar', () => {
describe
(
'
passing of props to gl-form-input
'
,
()
=>
{
beforeEach
(()
=>
{
createComponent
({
active
List
Id
:
listId
},
{
updateListWipLimit
:
()
=>
{}
},
{
edit
:
true
});
createComponent
({
activeId
:
listId
},
{
updateListWipLimit
:
()
=>
{}
},
{
edit
:
true
});
});
it
(
'
passes `trim`
'
,
()
=>
{
...
...
ee/spec/frontend/boards/stores/actions_spec.js
View file @
06212e0c
...
...
@@ -3,7 +3,7 @@ import boardsStoreEE from 'ee/boards/stores/boards_store_ee';
import
actions
from
'
ee/boards/stores/actions
'
;
import
*
as
types
from
'
ee/boards/stores/mutation_types
'
;
import
testAction
from
'
helpers/vuex_action_helper
'
;
import
{
inactive
List
Id
}
from
'
~/boards/constants
'
;
import
{
inactiveId
}
from
'
~/boards/constants
'
;
jest
.
mock
(
'
axios
'
);
...
...
@@ -30,14 +30,14 @@ describe('setShowLabels', () => {
});
});
describe
(
'
setActive
List
Id
'
,
()
=>
{
describe
(
'
setActiveId
'
,
()
=>
{
it
(
'
should commit mutation SET_ACTIVE_LIST_ID
'
,
done
=>
{
const
state
=
{
active
ListId
:
inactiveList
Id
,
active
Id
:
inactive
Id
,
};
testAction
(
actions
.
setActive
List
Id
,
actions
.
setActiveId
,
1
,
state
,
[{
type
:
types
.
SET_ACTIVE_LIST_ID
,
payload
:
1
}],
...
...
@@ -63,11 +63,11 @@ describe('updateListWipLimit', () => {
it
(
'
should call the correct url
'
,
()
=>
{
axios
.
put
.
mockResolvedValue
({
data
:
{}
});
const
maxIssueCount
=
0
;
const
active
List
Id
=
1
;
const
activeId
=
1
;
return
actions
.
updateListWipLimit
({
state
:
{
active
List
Id
}
},
{
maxIssueCount
}).
then
(()
=>
{
return
actions
.
updateListWipLimit
({
state
:
{
activeId
}
},
{
maxIssueCount
}).
then
(()
=>
{
expect
(
axios
.
put
).
toHaveBeenCalledWith
(
`
${
boardsStoreEE
.
store
.
state
.
endpoints
.
listsEndpoint
}
/
${
active
List
Id
}
`
,
`
${
boardsStoreEE
.
store
.
state
.
endpoints
.
listsEndpoint
}
/
${
activeId
}
`
,
{
list
:
{
max_issue_count
:
maxIssueCount
}
},
);
});
...
...
ee/spec/frontend/boards/stores/mutations_spec.js
View file @
06212e0c
import
mutations
from
'
ee/boards/stores/mutations
'
;
import
{
inactive
List
Id
}
from
'
~/boards/constants
'
;
import
{
inactiveId
}
from
'
~/boards/constants
'
;
import
{
mockLists
,
mockEpics
}
from
'
../mock_data
'
;
const
expectNotImplemented
=
action
=>
{
...
...
@@ -24,12 +24,12 @@ describe('SET_ACTIVE_LIST_ID', () => {
it
(
'
updates aciveListId to be the value that is passed
'
,
()
=>
{
const
expectedId
=
1
;
const
state
=
{
active
ListId
:
inactiveList
Id
,
active
Id
:
inactive
Id
,
};
mutations
.
SET_ACTIVE_LIST_ID
(
state
,
expectedId
);
expect
(
state
.
active
List
Id
).
toBe
(
expectedId
);
expect
(
state
.
activeId
).
toBe
(
expectedId
);
});
});
...
...
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