mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
Move api tests to v2 namespace
This commit is contained in:
28
test/api/v2/user/tasks/GET-tasks.test.js
Normal file
28
test/api/v2/user/tasks/GET-tasks.test.js
Normal file
@@ -0,0 +1,28 @@
|
||||
import {
|
||||
generateUser,
|
||||
requester,
|
||||
translate as t,
|
||||
} from '../../../../helpers/api-integration.helper';
|
||||
|
||||
describe('GET /user/tasks/', () => {
|
||||
let api, user;
|
||||
|
||||
beforeEach(() => {
|
||||
return generateUser().then((_user) => {
|
||||
user = _user;
|
||||
api = requester(user);
|
||||
});
|
||||
});
|
||||
|
||||
it('gets all tasks', () => {
|
||||
return api.get(`/user/tasks/`).then((tasks) => {
|
||||
expect(tasks).to.be.an('array');
|
||||
expect(tasks.length).to.be.greaterThan(4);
|
||||
|
||||
let task = tasks[0];
|
||||
expect(task.id).to.exist;
|
||||
expect(task.type).to.exist;
|
||||
expect(task.text).to.exist;
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user