Skip to content
Snippets Groups Projects
Verified Commit ad80ddfc authored by Georg Krause's avatar Georg Krause
Browse files

Fix frontend tests

parent 1a3cb023
No related branches found
No related tags found
No related merge requests found
......@@ -183,10 +183,7 @@ export default {
axios.get('users/me/').then((response) => {
logger.default.info('Successfully fetched user profile')
dispatch('ui/initSettings', response.data.settings, { root: true })
dispatch('updateProfile', response.data).then(() => {
resolve(response.data)
})
dispatch('updateProfile', response.data)
dispatch('ui/fetchUnreadNotifications', null, { root: true })
if (response.data.permissions.library) {
dispatch('ui/fetchPendingReviewEdits', null, { root: true })
......@@ -200,6 +197,7 @@ export default {
dispatch('libraries/fetchFollows', null, { root: true })
dispatch('moderation/fetchContentFilters', null, { root: true })
dispatch('playlists/fetchOwn', null, { root: true })
resolve(response.data)
}, (response) => {
logger.default.info('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} }
],
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: '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} }
]
})
......
......@@ -274,7 +274,7 @@ describe('store/queue', () => {
it('shuffle', () => {
let _shuffle = sandbox.stub(_, 'shuffle')
let tracks = ['a', 'b', 'c', 'd', 'e']
let shuffledTracks = ['e', 'd', 'c']
let shuffledTracks = ['a', 'b', 'e', 'd', 'c']
_shuffle.returns(shuffledTracks)
testAction({
action: store.actions.shuffle,
......@@ -283,7 +283,8 @@ describe('store/queue', () => {
{ type: 'tracks', payload: [] }
],
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 }
],
expectedActions: [
{ type: 'populateQueue' }
{ type: 'populateQueue', payload: true }
]
})
})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment