Trying to fix tests again.
This commit is contained in:
parent
0b551ecbac
commit
752e40c8f0
3 changed files with 15 additions and 16 deletions
17
ui/src/api_tests/comment.spec.ts
vendored
17
ui/src/api_tests/comment.spec.ts
vendored
|
@ -31,6 +31,7 @@ beforeAll(async () => {
|
|||
await followBeta(alpha);
|
||||
await followBeta(gamma);
|
||||
let search = await searchForBetaCommunity(alpha);
|
||||
await delay(10000);
|
||||
postRes = await createPost(
|
||||
alpha,
|
||||
search.communities.filter(c => c.local == false)[0].id
|
||||
|
@ -48,7 +49,7 @@ test('Create a comment', async () => {
|
|||
expect(commentRes.comment.community_local).toBe(false);
|
||||
expect(commentRes.comment.creator_local).toBe(true);
|
||||
expect(commentRes.comment.score).toBe(1);
|
||||
await delay(5000);
|
||||
await delay();
|
||||
|
||||
// Make sure that comment is liked on beta
|
||||
let searchBeta = await searchComment(beta, commentRes.comment);
|
||||
|
@ -92,16 +93,10 @@ test('Delete a comment', async () => {
|
|||
expect(deleteCommentRes.comment.deleted).toBe(true);
|
||||
await delay();
|
||||
|
||||
// Make sure that comment is deleted on beta
|
||||
// The search doesnt work below, because it returns a tombstone / http::gone
|
||||
// let searchBeta = await searchComment(beta, commentRes.comment);
|
||||
// console.log(searchBeta);
|
||||
// let betaComment = searchBeta.comments[0];
|
||||
// Create a fake post, just to get the previous new post id
|
||||
let createdBetaPostJustToGetId = await createPost(beta, 2);
|
||||
let betaPost = await getPost(beta, createdBetaPostJustToGetId.post.id - 1);
|
||||
let betaComment = betaPost.comments[0];
|
||||
expect(betaComment.deleted).toBe(true);
|
||||
// Make sure that comment is undefined on beta
|
||||
let searchBeta = await searchComment(beta, commentRes.comment);
|
||||
let betaComment = searchBeta.comments[0];
|
||||
expect(betaComment).toBeUndefined();
|
||||
await delay();
|
||||
|
||||
let undeleteCommentRes = await deleteComment(
|
||||
|
|
10
ui/src/api_tests/post.spec.ts
vendored
10
ui/src/api_tests/post.spec.ts
vendored
|
@ -28,6 +28,7 @@ beforeAll(async () => {
|
|||
await followBeta(gamma);
|
||||
await followBeta(delta);
|
||||
await followBeta(epsilon);
|
||||
await delay(10000);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
|
@ -45,7 +46,7 @@ test('Create a post', async () => {
|
|||
expect(postRes.post.community_local).toBe(false);
|
||||
expect(postRes.post.creator_local).toBe(true);
|
||||
expect(postRes.post.score).toBe(1);
|
||||
await delay(5000);
|
||||
await delay();
|
||||
|
||||
// Make sure that post is liked on beta
|
||||
let searchBeta = await searchPost(beta, postRes.post);
|
||||
|
@ -204,11 +205,12 @@ test('Delete a post', async () => {
|
|||
|
||||
let deletedPost = await deletePost(alpha, true, postRes.post);
|
||||
expect(deletedPost.post.deleted).toBe(true);
|
||||
await delay(5000);
|
||||
await delay();
|
||||
|
||||
// Make sure lemmy beta sees post is deleted
|
||||
let createFakeBetaPostToGetId = (await createPost(beta, 2)).post.id - 1;
|
||||
let newPost = await createPost(beta, 2);
|
||||
await delay();
|
||||
let createFakeBetaPostToGetId = newPost.post.id - 1;
|
||||
let betaPost = await getPost(beta, createFakeBetaPostToGetId);
|
||||
expect(betaPost.post.deleted).toBe(true);
|
||||
await delay();
|
||||
|
@ -266,7 +268,7 @@ test('Remove a post from admin and community on same instance', async () => {
|
|||
// The beta admin removes it (the community lives on beta)
|
||||
let removePostRes = await removePost(beta, true, betaPost.post);
|
||||
expect(removePostRes.post.removed).toBe(true);
|
||||
await delay(5000);
|
||||
await delay();
|
||||
|
||||
// Make sure lemmy alpha sees post is removed
|
||||
let alphaPost = await getPost(alpha, postRes.post.id);
|
||||
|
|
4
ui/src/api_tests/private_message.spec.ts
vendored
4
ui/src/api_tests/private_message.spec.ts
vendored
|
@ -15,7 +15,9 @@ let recipient_id: number;
|
|||
|
||||
beforeAll(async () => {
|
||||
await setupLogins();
|
||||
recipient_id = (await followBeta(alpha)).community.creator_id;
|
||||
let follow = await followBeta(alpha);
|
||||
await delay(10000);
|
||||
recipient_id = follow.community.creator_id;
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
|
|
Loading…
Reference in a new issue