mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
tests(api): Convert tests to use new api user methods
This commit is contained in:
@@ -1,11 +1,10 @@
|
||||
import {
|
||||
generateUser,
|
||||
requester,
|
||||
translate as t,
|
||||
} from '../../../../helpers/api-integration.helper';
|
||||
|
||||
describe('GET /user/tasks/', () => {
|
||||
let api, user;
|
||||
let user;
|
||||
|
||||
beforeEach(() => {
|
||||
return generateUser({
|
||||
@@ -17,12 +16,11 @@ describe('GET /user/tasks/', () => {
|
||||
],
|
||||
}).then((_user) => {
|
||||
user = _user;
|
||||
api = requester(user);
|
||||
});
|
||||
});
|
||||
|
||||
it('gets all tasks', () => {
|
||||
return api.get(`/user/tasks/`).then((tasks) => {
|
||||
return user.get(`/user/tasks/`).then((tasks) => {
|
||||
expect(tasks).to.be.an('array');
|
||||
expect(tasks.length).to.be.greaterThan(3);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user