diff --git a/api_tests/package.json b/api_tests/package.json index 7a349c110..f741698a7 100644 --- a/api_tests/package.json +++ b/api_tests/package.json @@ -27,7 +27,7 @@ "eslint": "^8.57.0", "eslint-plugin-prettier": "^5.0.1", "jest": "^29.5.0", - "lemmy-js-client": "0.19.4-alpha.9", + "lemmy-js-client": "0.19.4-alpha.10", "prettier": "^3.2.5", "ts-jest": "^29.1.0", "typescript": "^5.3.3" diff --git a/api_tests/pnpm-lock.yaml b/api_tests/pnpm-lock.yaml index 6230eb979..b6f7038e0 100644 --- a/api_tests/pnpm-lock.yaml +++ b/api_tests/pnpm-lock.yaml @@ -30,8 +30,8 @@ devDependencies: specifier: ^29.5.0 version: 29.7.0(@types/node@20.11.22) lemmy-js-client: - specifier: 0.19.4-alpha.9 - version: 0.19.4-alpha.9 + specifier: 0.19.4-alpha.10 + version: 0.19.4-alpha.10 prettier: specifier: ^3.2.5 version: 3.2.5 @@ -2390,8 +2390,8 @@ packages: engines: {node: '>=6'} dev: true - /lemmy-js-client@0.19.4-alpha.9: - resolution: {integrity: sha512-krvrTXKji+y6huy91Qyav5e5ueKfWPKuKp6eE3OS3IEsyqsleU2drJRt0QAb8Gx/Qw+7V0y5uwWdalrKA5J78A==} + /lemmy-js-client@0.19.4-alpha.10: + resolution: {integrity: sha512-/08YJU2x9KhCj2s9eNG31GlTy3Y7OaTPIhS+3LfZbcHRhYrwgPcIu3/zvh/HgwvpnXEmjo2ToJsH0+RUvSmgpA==} dependencies: cross-fetch: 4.0.0 form-data: 4.0.0 diff --git a/api_tests/src/image.spec.ts b/api_tests/src/image.spec.ts index 8043d30b7..cec4d4137 100644 --- a/api_tests/src/image.spec.ts +++ b/api_tests/src/image.spec.ts @@ -49,9 +49,13 @@ test("Upload image and delete it", async () => { expect(content.length).toBeGreaterThan(0); // Ensure that it comes back with the list_media endpoint - const listMediaRes = await alphaImage.listMedia({}); + const listMediaRes = await alphaImage.listMedia(); expect(listMediaRes.images.length).toBe(1); + // Ensure that it also comes back with the admin all images + const listAllMediaRes = await alphaImage.listAllMedia(); + expect(listAllMediaRes.images.length).toBe(1); + // The deleteUrl is a combination of the endpoint, delete token, and alias let firstImage = listMediaRes.images[0]; let deleteUrl = `${alphaUrl}/pictrs/image/delete/${firstImage.pictrs_delete_token}/${firstImage.pictrs_alias}`; @@ -70,11 +74,11 @@ test("Upload image and delete it", async () => { expect(content2).toBe(""); // Ensure that it shows the image is deleted - const deletedListMediaRes = await alphaImage.listMedia({}); + const deletedListMediaRes = await alphaImage.listMedia(); expect(deletedListMediaRes.images.length).toBe(0); // Ensure that the admin shows its deleted - const deletedListAllMediaRes = await alphaImage.listAllMedia({}); + const deletedListAllMediaRes = await alphaImage.listAllMedia(); expect(deletedListAllMediaRes.images.length).toBe(0); });