fix: #7190 tests
gitea/salix-front/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Javier Segarra 2024-04-23 08:03:09 +02:00
parent 6018d51642
commit 04fe9330d4
1 changed files with 11 additions and 3 deletions

View File

@ -96,7 +96,11 @@ describe('session', () => {
const expectedTokenMultimedia = 'mySessionTokenMultimedia'; const expectedTokenMultimedia = 'mySessionTokenMultimedia';
const keepLogin = false; const keepLogin = false;
await session.login(expectedToken,expectedTokenMultimedia, keepLogin); await session.login({
token: expectedToken,
tokenMultimedia: expectedTokenMultimedia,
keepLogin,
});
const roles = state.getRoles(); const roles = state.getRoles();
const localToken = localStorage.getItem('token'); const localToken = localStorage.getItem('token');
@ -106,7 +110,7 @@ describe('session', () => {
expect(localToken).toBeNull(); expect(localToken).toBeNull();
expect(sessionToken).toEqual(expectedToken); expect(sessionToken).toEqual(expectedToken);
await session.destroy(); // this clears token and user for any other test await session.destroy(); // this clears token and user for any other test
}); });
it('should fetch the user roles and then set token in the localStorage', async () => { it('should fetch the user roles and then set token in the localStorage', async () => {
@ -119,7 +123,11 @@ describe('session', () => {
const expectedTokenMultimedia = 'myLocalTokenMultimedia'; const expectedTokenMultimedia = 'myLocalTokenMultimedia';
const keepLogin = true; const keepLogin = true;
await session.login(expectedToken, expectedTokenMultimedia, keepLogin); await session.login({
token: expectedToken,
tokenMultimedia: expectedTokenMultimedia,
keepLogin,
});
const roles = state.getRoles(); const roles = state.getRoles();
const localToken = localStorage.getItem('token'); const localToken = localStorage.getItem('token');