aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Tumin <iamtakingiteasy@eientei.org>2022-08-06 18:03:04 +0300
committerAlexander Tumin <iamtakingiteasy@eientei.org>2022-08-06 18:28:49 +0300
commitb5eba5974ca86cdb0b5f3caaa9c89466a07d8449 (patch)
tree6c921edefbe58489467b4f3229f84d3349d2e5ff
parent171f6f08943dd1d87120df3e4894ddcfd5e1d246 (diff)
Lists implementation: tests, linter fix
-rw-r--r--src/modules/lists.js2
-rw-r--r--test/unit/specs/boot/routes.spec.js6
2 files changed, 4 insertions, 4 deletions
diff --git a/src/modules/lists.js b/src/modules/lists.js
index 58700f41..84c15759 100644
--- a/src/modules/lists.js
+++ b/src/modules/lists.js
@@ -57,7 +57,7 @@ const actions = {
commit('setList', { id, title })
},
setListAccounts ({ rootState, commit }, { id, accountIds }) {
- const saved = rootState.lists.allListsObject[id].accountIds
+ const saved = rootState.lists.allListsObject[id].accountIds || []
const added = accountIds.filter(id => !saved.includes(id))
const removed = saved.filter(id => !accountIds.includes(id))
commit('setListAccounts', { id, accountIds })
diff --git a/test/unit/specs/boot/routes.spec.js b/test/unit/specs/boot/routes.spec.js
index 4c387567..ff246d2b 100644
--- a/test/unit/specs/boot/routes.spec.js
+++ b/test/unit/specs/boot/routes.spec.js
@@ -46,7 +46,7 @@ describe('routes', () => {
const matchedComponents = router.currentRoute.value.matched
- expect(matchedComponents[0].components.default.components.hasOwnProperty('ListsCard')).to.eql(true)
+ expect(Object.prototype.hasOwnProperty.call(matchedComponents[0].components.default.components, 'ListsCard')).to.eql(true)
})
it('list timeline', async () => {
@@ -54,7 +54,7 @@ describe('routes', () => {
const matchedComponents = router.currentRoute.value.matched
- expect(matchedComponents[0].components.default.components.hasOwnProperty('Timeline')).to.eql(true)
+ expect(Object.prototype.hasOwnProperty.call(matchedComponents[0].components.default.components, 'Timeline')).to.eql(true)
})
it('list edit', async () => {
@@ -62,6 +62,6 @@ describe('routes', () => {
const matchedComponents = router.currentRoute.value.matched
- expect(matchedComponents[0].components.default.components.hasOwnProperty('BasicUserCard')).to.eql(true)
+ expect(Object.prototype.hasOwnProperty.call(matchedComponents[0].components.default.components, 'BasicUserCard')).to.eql(true)
})
})