refs #5655 fix unit test
gitea/salix-front/pipeline/head This commit looks good Details

This commit is contained in:
Alexandre Riera 2023-05-11 09:05:48 +02:00
parent 1627f9cd36
commit c4f40fbb59
1 changed files with 5 additions and 4 deletions

View File

@ -23,9 +23,6 @@ describe('useRole', () => {
name: `T'Challa`, name: `T'Challa`,
nickname: 'Black Panther', nickname: 'Black Panther',
lang: 'en', lang: 'en',
userConfig: {
darkMode: false,
},
}; };
const expectedUser = { const expectedUser = {
id: 999, id: 999,
@ -35,8 +32,12 @@ describe('useRole', () => {
darkMode: false, darkMode: false,
}; };
const expectedRoles = ['salesPerson', 'admin']; const expectedRoles = ['salesPerson', 'admin'];
vi.spyOn(axios, 'get').mockResolvedValue({ vi.spyOn(axios, 'get')
.mockResolvedValueOnce({
data: { roles: rolesData, user: fetchedUser }, data: { roles: rolesData, user: fetchedUser },
})
.mockResolvedValueOnce({
data: { darkMode: false },
}); });
vi.spyOn(role.state, 'setUser'); vi.spyOn(role.state, 'setUser');