mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 07:07:35 +01:00
25 lines
583 B
JavaScript
25 lines
583 B
JavaScript
import {
|
|
generateUser,
|
|
requester,
|
|
} from '../../helpers/api.helper';
|
|
|
|
describe('GET /user', () => {
|
|
let user;
|
|
|
|
beforeEach(() => {
|
|
return generateUser().then((usr) => {
|
|
user = usr;
|
|
});
|
|
});
|
|
|
|
it('gets the user object', () => {
|
|
let api = requester(user);
|
|
return api.get('/user').then((fetchedUser) => {
|
|
expect(fetchedUser._id).to.eql(user._id);
|
|
expect(fetchedUser.auth.local.username).to.eql(user.auth.local.username);
|
|
expect(fetchedUser.todos).to.eql(user.todos);
|
|
expect(fetchedUser.items).to.eql(user.items);
|
|
});
|
|
});
|
|
});
|