update pretty much everything

update tests to workaround (I think) this thing https://github.com/facebook/jest/issues/9624
didn't update react-spring because too lazy
This commit is contained in:
2020-08-14 14:44:44 +03:00
parent 1d0e51f673
commit 052256788e
9 changed files with 11617 additions and 14568 deletions

View File

@@ -71,7 +71,7 @@ describe('test lists', () => {
expect(response.body.success).toBeTruthy();
expect(await TodoList.findOne({ name: 'List2' })).toBeTruthy();
const freshUser = await User.findById(user.id).exec();
expect(freshUser.lists).toContain(response.body.data.id);
expect(freshUser.lists.map(l => String(l))).toContain(response.body.data.id);
});
test('should create list with custom id', async () => {
const id = mongoose.Types.ObjectId();
@@ -89,7 +89,7 @@ describe('test lists', () => {
expect(response.body.success).toBeTruthy();
expect(await TodoList.findOne({ name: 'List2', _id: id })).toBeTruthy();
const freshUser = await User.findById(user.id).exec();
expect(freshUser.lists).toContain(response.body.data.id);
expect(freshUser.lists.map(l => String(l))).toContain(response.body.data.id);
});
test('should not create list without authentication', async () => {
@@ -151,7 +151,7 @@ describe('test lists', () => {
expect(await TodoList.findOne({ name: 'List1' }).exec()).toBeTruthy();
expect(await Todo.findOne({ text: 'Todo1' }).exec()).toBeTruthy();
const freshUser = await User.findById(user.id).exec();
expect(freshUser.lists).toContain(list._id);
expect(freshUser.todos).toContain(todo._id);
expect(freshUser.lists.map(l => String(l))).toContain(String(list._id));
expect(freshUser.todos.map(t => String(t))).toContain(String(todo._id));
});
});