Skip to content

Commit edb7b2d

Browse files
committed
production: * fix id instead of postId of port object in backend tests
1 parent 8e40541 commit edb7b2d

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

server/tests/api/3-delete-post/post.api.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ describe(`${postApiPath} routes`, () => {
9898
});
9999

100100
expect(deletePostResponse.statusCode).toBe(HttpCode.FORBIDDEN);
101-
expect(getPostResponse.json()).not.toHaveProperty('deletedAt');
101+
expect(getPostResponse.json()).toMatchObject(postToDelete);
102102
});
103103

104104
it(`should return ${HttpCode.OK} with soft deleted post`, async () => {

server/tests/api/8-show-liked-by-own-posts/post.api.spec.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,9 @@ describe(`${postApiPath} routes`, () => {
9595
});
9696

9797
expect(response.statusCode).toBe(HttpCode.OK);
98-
expect(response.json()).toEqual([
99-
expect.objectContaining({
100-
postId
101-
})
102-
]);
98+
expect(response.json()).toEqual(
99+
expect.arrayContaining([expect.objectContaining({ id: postId })])
100+
);
103101
});
104102

105103
it(`should return ${HttpCode.OK} with all users' posts`, async () => {
@@ -117,9 +115,7 @@ describe(`${postApiPath} routes`, () => {
117115
expect.objectContaining({
118116
userId: expect.not.stringContaining(userId)
119117
}),
120-
expect.objectContaining({
121-
userId
122-
})
118+
expect.objectContaining({ userId })
123119
]);
124120
});
125121
});

0 commit comments

Comments
 (0)