mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
Api v3 Migration (WIP) (#7131)
* v3 migration: remove old code and polish user migration * v3 migration: start to work on challenges * wip v3 migration * wip v3 migration: fix _id -> id for reminders, tags and checklists
This commit is contained in:
@@ -154,14 +154,14 @@ describe('POST /tasks/user', () => {
|
||||
text: 'test habit',
|
||||
type: 'habit',
|
||||
reminders: [
|
||||
{_id: id1, startDate: new Date(), time: new Date()},
|
||||
{id: id1, startDate: new Date(), time: new Date()},
|
||||
],
|
||||
});
|
||||
|
||||
expect(task.reminders).to.be.an('array');
|
||||
expect(task.reminders.length).to.eql(1);
|
||||
expect(task.reminders[0]).to.be.an('object');
|
||||
expect(task.reminders[0]._id).to.eql(id1);
|
||||
expect(task.reminders[0].id).to.eql(id1);
|
||||
expect(task.reminders[0].startDate).to.be.a('string'); // json doesn't have dates
|
||||
expect(task.reminders[0].time).to.be.a('string');
|
||||
});
|
||||
@@ -345,7 +345,7 @@ describe('POST /tasks/user', () => {
|
||||
expect(task.checklist[0]).to.be.an('object');
|
||||
expect(task.checklist[0].text).to.eql('checklist');
|
||||
expect(task.checklist[0].completed).to.eql(false);
|
||||
expect(task.checklist[0]._id).to.be.a('string');
|
||||
expect(task.checklist[0].id).to.be.a('string');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -487,7 +487,7 @@ describe('POST /tasks/user', () => {
|
||||
expect(task.checklist[0]).to.be.an('object');
|
||||
expect(task.checklist[0].text).to.eql('checklist');
|
||||
expect(task.checklist[0].completed).to.eql(false);
|
||||
expect(task.checklist[0]._id).to.be.a('string');
|
||||
expect(task.checklist[0].id).to.be.a('string');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user