Add tests

This commit is contained in:
Sol Fisher Romanoff 2022-06-18 18:15:51 +03:00
parent a6136f6cb2
commit ba4656312a
No known key found for this signature in database
GPG key ID: 9D3F2B64F2341B62
3 changed files with 115 additions and 3 deletions

View file

@ -5,7 +5,7 @@ export const defaultState = {
allListsObject: {}
}
const mutations = {
export const mutations = {
setLists (state, value) {
state.allLists = value
},
@ -14,7 +14,12 @@ const mutations = {
state.allListsObject[id] = {}
}
state.allListsObject[id].title = title
find(state.allLists, { id }).title = title
if (!find(state.allLists, { id })) {
state.allLists.push({ id, title })
} else {
find(state.allLists, { id }).title = title
}
},
setListAccounts (state, { id, accountIds }) {
if (!state.allListsObject[id]) {
@ -65,7 +70,7 @@ const actions = {
}
}
const getters = {
export const getters = {
findListTitle: state => id => {
if (!state.allListsObject[id]) return
return state.allListsObject[id].title