mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 07:37:25 +01:00
Change convention for naming tests
This commit is contained in:
28
test/api/user/GET-user.test.js
Normal file
28
test/api/user/GET-user.test.js
Normal file
@@ -0,0 +1,28 @@
|
||||
import {
|
||||
generateUser,
|
||||
requester,
|
||||
} from '../../helpers/api.helper';
|
||||
|
||||
describe('GET /user', () => {
|
||||
let api, user;
|
||||
|
||||
beforeEach((done) => {
|
||||
generateUser().then((usr) => {
|
||||
user = usr;
|
||||
api = requester(usr);
|
||||
done();
|
||||
}).catch(done);
|
||||
});
|
||||
|
||||
it('gets the user object', (done) => {
|
||||
api.get('/user')
|
||||
.then((fetchedUser) => {
|
||||
expect(fetchedUser._id).to.eql(user._id);
|
||||
expect(fetchedUser.todos).to.eql(user.todos);
|
||||
done();
|
||||
})
|
||||
.catch((err) => {
|
||||
done(err);
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user