mirror of
https://github.com/usatiuk/ustk-todolist.git
synced 2025-10-28 15:47:48 +01:00
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:
@@ -82,9 +82,9 @@ describe('test todos', () => {
|
||||
expect(response.body.success).toBeTruthy();
|
||||
expect(await Todo.findOne({ text: 'Todo2', list: list._id })).toBeTruthy();
|
||||
const freshUser = await User.findById(user.id).exec();
|
||||
expect(freshUser.todos).toContain(response.body.data.id);
|
||||
expect(freshUser.todos.map(t => String(t))).toContain(response.body.data.id);
|
||||
const freshList = await TodoList.findById(list.id).exec();
|
||||
expect(freshList.todos).toContain(response.body.data.id);
|
||||
expect(freshList.todos.map(t => String(t))).toContain(response.body.data.id);
|
||||
});
|
||||
test('should create todo with custom id', async () => {
|
||||
const id = mongoose.Types.ObjectId();
|
||||
@@ -104,9 +104,9 @@ describe('test todos', () => {
|
||||
await Todo.findOne({ text: 'Todo2', list: list._id, _id: id }),
|
||||
).toBeTruthy();
|
||||
const freshUser = await User.findById(user.id).exec();
|
||||
expect(freshUser.todos).toContain(response.body.data.id);
|
||||
expect(freshUser.todos.map(t => String(t))).toContain(response.body.data.id);
|
||||
const freshList = await TodoList.findById(list.id).exec();
|
||||
expect(freshList.todos).toContain(response.body.data.id);
|
||||
expect(freshList.todos.map(t => String(t))).toContain(response.body.data.id);
|
||||
});
|
||||
test('should not create todo without authentication', async () => {
|
||||
await request(server)
|
||||
|
||||
Reference in New Issue
Block a user