Lists implementation: tests, linter fix

This commit is contained in:
Alexander Tumin 2022-08-06 18:03:04 +03:00
parent 171f6f0894
commit b5eba5974c
2 changed files with 4 additions and 4 deletions

View File

@ -57,7 +57,7 @@ const actions = {
commit('setList', { id, title }) commit('setList', { id, title })
}, },
setListAccounts ({ rootState, commit }, { id, accountIds }) { 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 added = accountIds.filter(id => !saved.includes(id))
const removed = saved.filter(id => !accountIds.includes(id)) const removed = saved.filter(id => !accountIds.includes(id))
commit('setListAccounts', { id, accountIds }) commit('setListAccounts', { id, accountIds })

View File

@ -46,7 +46,7 @@ describe('routes', () => {
const matchedComponents = router.currentRoute.value.matched 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 () => { it('list timeline', async () => {
@ -54,7 +54,7 @@ describe('routes', () => {
const matchedComponents = router.currentRoute.value.matched 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 () => { it('list edit', async () => {
@ -62,6 +62,6 @@ describe('routes', () => {
const matchedComponents = router.currentRoute.value.matched 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)
}) })
}) })