Skip to content
This repository has been archived by the owner on Sep 29, 2024. It is now read-only.

Commit

Permalink
register
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasEbbinghaus25 committed Jun 12, 2024
1 parent d7840a0 commit d840d6e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/main/web/src/services/tests/AuthService.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,17 @@ describe('AuthService', () => {
const username = 'testuser';
const email = 'test@example.com';
const password = 'password';
const responseData = {message: 'User registered successfully'};
const rememberMe = false;
const responseData = {accountId: 1, userId: 2, username: 'testuser', accessToken: 'jwt-token'};
mock.onPost(config.apiUrl + 'api/auth/signup').reply(200, responseData);

const response = await authService.register(username, email, password);

expect(response.data).toEqual(responseData);
expect(localStorage.getItem('accountId')).toEqual('1');
expect(localStorage.getItem('userId')).toEqual('2');
expect(localStorage.getItem('username')).toEqual('testuser');
expect(localStorage.getItem('token')).toEqual('jwt-token');
});
});

Expand Down

0 comments on commit d840d6e

Please sign in to comment.