diff --git a/api_tests/package.json b/api_tests/package.json index cfca45f56..22721d3fd 100644 --- a/api_tests/package.json +++ b/api_tests/package.json @@ -28,7 +28,7 @@ "eslint": "^9.16.0", "eslint-plugin-prettier": "^5.1.3", "jest": "^29.5.0", - "lemmy-js-client": "0.20.0-image-api-rework.8", + "lemmy-js-client": "0.20.0-modlog-combined.0", "prettier": "^3.4.2", "ts-jest": "^29.1.0", "typescript": "^5.7.2", diff --git a/api_tests/pnpm-lock.yaml b/api_tests/pnpm-lock.yaml index 514160db3..4e32da73f 100644 --- a/api_tests/pnpm-lock.yaml +++ b/api_tests/pnpm-lock.yaml @@ -30,8 +30,8 @@ importers: specifier: ^29.5.0 version: 29.7.0(@types/node@22.10.1) lemmy-js-client: - specifier: 0.20.0-image-api-rework.8 - version: 0.20.0-image-api-rework.8 + specifier: 0.20.0-modlog-combined.0 + version: 0.20.0-modlog-combined.0 prettier: specifier: ^3.4.2 version: 3.4.2 @@ -1166,8 +1166,8 @@ packages: resolution: {integrity: sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==} engines: {node: '>=6'} - lemmy-js-client@0.20.0-image-api-rework.8: - resolution: {integrity: sha512-Ns/ayfCSm2lHbdAU1tGIZSx6kJ2ZeS7UiXlPuH0IzHQSi8Yuyzj3srDCyHpE6Td3pmXbQlt9N1ziPE4KeRJ3CA==} + lemmy-js-client@0.20.0-modlog-combined.0: + resolution: {integrity: sha512-lb3na39klOSE184hJJObMufKjHtm3Mrk42RHqyVNCYZQ+FAAbQzBFTuYyqv8QJV5TJlMmyFO2v1v/9cH72nLRg==} leven@3.1.0: resolution: {integrity: sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==} @@ -3078,7 +3078,7 @@ snapshots: kleur@3.0.3: {} - lemmy-js-client@0.20.0-image-api-rework.8: {} + lemmy-js-client@0.20.0-modlog-combined.0: {} leven@3.1.0: {} diff --git a/api_tests/src/comment.spec.ts b/api_tests/src/comment.spec.ts index 419e58769..0a937847e 100644 --- a/api_tests/src/comment.spec.ts +++ b/api_tests/src/comment.spec.ts @@ -27,7 +27,6 @@ import { getComments, getCommentParentId, resolveCommunity, - getPersonDetails, getReplies, getUnreadCount, waitUntil, @@ -38,6 +37,7 @@ import { delay, saveUserSettings, listReports, + listPersonContent, } from "./shared"; import { CommentReportView, @@ -210,11 +210,13 @@ test.skip("Remove a comment from admin and community on the same instance", asyn expect(removeCommentRes.comment_view.comment.removed).toBe(true); // Make sure that comment is removed on alpha (it gets pushed since an admin from beta removed it) - let refetchedPostComments = await getPersonDetails( + let refetchedPostComments = await listPersonContent( alpha, commentRes.comment_view.comment.creator_id, + "Comments", ); - expect(refetchedPostComments.comments[0].comment.removed).toBe(true); + let firstRefetchedComment = refetchedPostComments.content[0] as CommentView; + expect(firstRefetchedComment.comment.removed).toBe(true); // beta will unremove the comment let unremoveCommentRes = await removeComment(beta, false, betaCommentId); diff --git a/api_tests/src/shared.ts b/api_tests/src/shared.ts index 44fcac4a2..771b1dc57 100644 --- a/api_tests/src/shared.ts +++ b/api_tests/src/shared.ts @@ -23,6 +23,9 @@ import { PrivateMessageReportResponse, SuccessResponse, UserBlockInstanceParams, + ListPersonContentResponse, + ListPersonContent, + PersonContentType, } from "lemmy-js-client"; import { CreatePost } from "lemmy-js-client/dist/types/CreatePost"; import { DeletePost } from "lemmy-js-client/dist/types/DeletePost"; @@ -735,6 +738,7 @@ export async function saveUserSettings( ): Promise { return api.saveUserSettings(form); } + export async function getPersonDetails( api: LemmyHttp, person_id: number, @@ -745,6 +749,18 @@ export async function getPersonDetails( return api.getPersonDetails(form); } +export async function listPersonContent( + api: LemmyHttp, + person_id: number, + type_?: PersonContentType, +): Promise { + let form: ListPersonContent = { + person_id, + type_, + }; + return api.listPersonContent(form); +} + export async function deleteUser(api: LemmyHttp): Promise { let form: DeleteAccount = { delete_content: true, diff --git a/api_tests/src/user.spec.ts b/api_tests/src/user.spec.ts index 551677262..edb8a4c83 100644 --- a/api_tests/src/user.spec.ts +++ b/api_tests/src/user.spec.ts @@ -75,7 +75,6 @@ test("Delete user", async () => { let user = await registerUser(alpha, alphaUrl); let user_profile = await getMyUser(user); let person_id = user_profile.local_user_view.person.id; - let actor_id = user_profile.local_user_view.person.actor_id; // make a local post and comment let alphaCommunity = (await resolveCommunity(user, "main@lemmy-alpha:8541"))