Fix frontend tests
This commit is contained in:
parent
1a3cb02345
commit
ad80ddfce4
|
@ -183,10 +183,7 @@ export default {
|
||||||
axios.get('users/me/').then((response) => {
|
axios.get('users/me/').then((response) => {
|
||||||
logger.default.info('Successfully fetched user profile')
|
logger.default.info('Successfully fetched user profile')
|
||||||
dispatch('ui/initSettings', response.data.settings, { root: true })
|
dispatch('ui/initSettings', response.data.settings, { root: true })
|
||||||
dispatch('updateProfile', response.data).then(() => {
|
dispatch('updateProfile', response.data)
|
||||||
resolve(response.data)
|
|
||||||
})
|
|
||||||
|
|
||||||
dispatch('ui/fetchUnreadNotifications', null, { root: true })
|
dispatch('ui/fetchUnreadNotifications', null, { root: true })
|
||||||
if (response.data.permissions.library) {
|
if (response.data.permissions.library) {
|
||||||
dispatch('ui/fetchPendingReviewEdits', null, { root: true })
|
dispatch('ui/fetchPendingReviewEdits', null, { root: true })
|
||||||
|
@ -200,6 +197,7 @@ export default {
|
||||||
dispatch('libraries/fetchFollows', null, { root: true })
|
dispatch('libraries/fetchFollows', null, { root: true })
|
||||||
dispatch('moderation/fetchContentFilters', null, { root: true })
|
dispatch('moderation/fetchContentFilters', null, { root: true })
|
||||||
dispatch('playlists/fetchOwn', null, { root: true })
|
dispatch('playlists/fetchOwn', null, { root: true })
|
||||||
|
resolve(response.data)
|
||||||
}, (response) => {
|
}, (response) => {
|
||||||
logger.default.info('Error while fetching user profile')
|
logger.default.info('Error while fetching user profile')
|
||||||
reject(new Error('Error while fetching user profile'))
|
reject(new Error('Error while fetching user profile'))
|
||||||
|
|
|
@ -159,7 +159,13 @@ describe('store/auth', () => {
|
||||||
{ type: 'permission', payload: {key: 'admin', status: true} }
|
{ type: 'permission', payload: {key: 'admin', status: true} }
|
||||||
],
|
],
|
||||||
expectedActions: [
|
expectedActions: [
|
||||||
|
{ type: 'ui/initSettings', payload: { root: true } },
|
||||||
|
{ type: 'updateProfile', payload: profile },
|
||||||
|
{ type: 'ui/fetchUnreadNotifications', payload: null },
|
||||||
{ type: 'favorites/fetch', payload: null, options: {root: true} },
|
{ type: 'favorites/fetch', payload: null, options: {root: true} },
|
||||||
|
{ type: 'channels/fetchSubscriptions', payload: null, options: {root: true} },
|
||||||
|
{ type: 'libraries/fetchFollows', payload: null, options: {root: true} },
|
||||||
|
{ type: 'moderation/fetchContentFilters', payload: null, options: {root: true} },
|
||||||
{ type: 'playlists/fetchOwn', payload: null, options: {root: true} }
|
{ type: 'playlists/fetchOwn', payload: null, options: {root: true} }
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
|
|
@ -274,7 +274,7 @@ describe('store/queue', () => {
|
||||||
it('shuffle', () => {
|
it('shuffle', () => {
|
||||||
let _shuffle = sandbox.stub(_, 'shuffle')
|
let _shuffle = sandbox.stub(_, 'shuffle')
|
||||||
let tracks = ['a', 'b', 'c', 'd', 'e']
|
let tracks = ['a', 'b', 'c', 'd', 'e']
|
||||||
let shuffledTracks = ['e', 'd', 'c']
|
let shuffledTracks = ['a', 'b', 'e', 'd', 'c']
|
||||||
_shuffle.returns(shuffledTracks)
|
_shuffle.returns(shuffledTracks)
|
||||||
testAction({
|
testAction({
|
||||||
action: store.actions.shuffle,
|
action: store.actions.shuffle,
|
||||||
|
@ -283,7 +283,8 @@ describe('store/queue', () => {
|
||||||
{ type: 'tracks', payload: [] }
|
{ type: 'tracks', payload: [] }
|
||||||
],
|
],
|
||||||
expectedActions: [
|
expectedActions: [
|
||||||
{ type: 'appendMany', payload: {tracks: ['a', 'b'].concat(shuffledTracks)} }
|
{ type: 'appendMany', payload: {tracks: shuffledTracks} },
|
||||||
|
{ type: 'currentIndex', payload: {tracks: shuffledTracks} }
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -51,7 +51,7 @@ describe('store/radios', () => {
|
||||||
{ type: 'running', payload: true }
|
{ type: 'running', payload: true }
|
||||||
],
|
],
|
||||||
expectedActions: [
|
expectedActions: [
|
||||||
{ type: 'populateQueue' }
|
{ type: 'populateQueue', payload: true }
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue