This commit is contained in:
parent
1627f9cd36
commit
c4f40fbb59
|
@ -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');
|
||||||
|
|
Loading…
Reference in New Issue