From f4bf197518ac0a2c0bccaca619c61d440d903063 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Thu, 14 Mar 2024 12:34:11 -0400 Subject: [PATCH] Add additional test. --- api_tests/package.json | 2 +- api_tests/pnpm-lock.yaml | 8 ++++---- api_tests/src/image.spec.ts | 4 ++++ src/api_routes_http.rs | 2 +- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/api_tests/package.json b/api_tests/package.json index 00fe252ae..7a349c110 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.7", + "lemmy-js-client": "0.19.4-alpha.9", "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 fbd2ed3dd..6230eb979 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.7 - version: 0.19.4-alpha.7 + specifier: 0.19.4-alpha.9 + version: 0.19.4-alpha.9 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.7: - resolution: {integrity: sha512-1xvSDlhJmU3IzhT2+pvqPWKHo0P/aYTlpObL3hLy1RgaZLapvn3W7XC48cOydas+MAm2WBFsiFX9bi5X+5FWFA==} + /lemmy-js-client@0.19.4-alpha.9: + resolution: {integrity: sha512-krvrTXKji+y6huy91Qyav5e5ueKfWPKuKp6eE3OS3IEsyqsleU2drJRt0QAb8Gx/Qw+7V0y5uwWdalrKA5J78A==} 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 7f736cf7e..8043d30b7 100644 --- a/api_tests/src/image.spec.ts +++ b/api_tests/src/image.spec.ts @@ -72,6 +72,10 @@ test("Upload image and delete it", async () => { // Ensure that it shows the image is deleted const deletedListMediaRes = await alphaImage.listMedia({}); expect(deletedListMediaRes.images.length).toBe(0); + + // Ensure that the admin shows its deleted + const deletedListAllMediaRes = await alphaImage.listAllMedia({}); + expect(deletedListAllMediaRes.images.length).toBe(0); }); test("Purge user, uploaded image removed", async () => { diff --git a/src/api_routes_http.rs b/src/api_routes_http.rs index bba3578a3..a1d58d781 100644 --- a/src/api_routes_http.rs +++ b/src/api_routes_http.rs @@ -342,7 +342,7 @@ pub fn config(cfg: &mut web::ServiceConfig, rate_limit: &RateLimitCell) { "/registration_application/approve", web::put().to(approve_registration_application), ) - .route("/list_media", web::get().to(list_all_media)) + .route("/list_all_media", web::get().to(list_all_media)) .service( web::scope("/purge") .route("/person", web::post().to(purge_person))