Fix tests

This commit is contained in:
An Phan 2016-12-17 16:10:08 +08:00
parent ba612f5dcc
commit 796ca1f413
No known key found for this signature in database
GPG key ID: 05536BB4BCDC02A2
2 changed files with 12 additions and 4 deletions

View file

@ -1,5 +1,5 @@
import Vue from 'vue'
import { reduce, each, find, union, difference, take, filter, orderBy } from 'lodash'
import { reduce, each, union, difference, take, filter, orderBy } from 'lodash'
import { secondsToHis } from '../utils'
import stub from '../stubs/album'
@ -151,6 +151,9 @@ export const albumStore = {
// Remove from the artist as well
each(albums, album => {
artistStore.removeAlbumsFromArtist(album.artist, album)
// Delete the cache while we're here
delete this.cache[album.id]
})
},

View file

@ -1,5 +1,5 @@
import Vue from 'vue'
import { reduce, each, find, union, difference, take, filter, orderBy } from 'lodash'
import { reduce, each, union, difference, take, filter, orderBy } from 'lodash'
import config from '../config'
import stub from '../stubs/artist'
@ -98,7 +98,6 @@ export const artistStore = {
each(artists, a => this.setupArtist(a))
this.all = union(this.all, artists)
},
/**
@ -107,7 +106,13 @@ export const artistStore = {
* @param {Array.<Object>|Object} artists
*/
remove (artists) {
this.all = difference(this.all, [].concat(artists))
artists = [].concat(artists)
this.all = difference(this.all, artists)
// Remember to clear the cache
each(artists, artist => {
delete this.cache[artist.id]
})
},
/**