forked from b00tc4mp/isdi-bootcamp-202405
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
modify deletePost.spec, getAllPosts.spec, toggleLikePost.spec and upd…
…atePostCaption.spec b00tc4mp#68
- Loading branch information
1 parent
c01f64e
commit fc8ab17
Showing
4 changed files
with
4 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,7 +46,7 @@ describe('deletePost', () => { | |
|
||
it('fails on existing user but non-existing post', () => { | ||
User.create({ name: 'gon', surname: 'zalo', email: '[email protected]', username: 'gonzalo', password: 'gonzalo123' }) | ||
.then(() => deletePost(user.id, new ObjectId().toString())) | ||
.then(user => deletePost(user.id, new ObjectId().toString())) | ||
.catch(error => _error = error) | ||
.finally(() => { | ||
expect(_error).to.be.instanceOf(NotFoundError) | ||
|
@@ -84,7 +84,7 @@ describe('deletePost', () => { | |
let error | ||
|
||
try { | ||
deletePost('gonzalo', 123) | ||
deletePost(new ObjectId().toString(), 123) | ||
} catch (_error) { | ||
error = _error | ||
} finally { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,7 @@ describe('updatePostCaption', () => { | |
User.create({ name: 'gon', surname: 'zalo', email: '[email protected]', username: 'gonzalo', password: 'gonzalo123' }) | ||
.then(user => { | ||
Post.create({ author: user.id, image: 'https://media.giphy.com/media/ji6zzUZwNIuLS/giphy.gif?cid=790b7611qml3yetzjkqcp26cvoxayvif8j713kmqj2yp06oi&ep=v1_gifs_trending&rid=giphy.gif&ct=g', caption: 'i am fine' }) | ||
.then(post => updatePostCaption('gonzalo', post.id, 'okay...')) | ||
.then(post => updatePostCaption(user.id, post.id, 'okay...')) | ||
|
||
Post.findById(post.id).lean() | ||
.then(post => { | ||
|