Add additional test.

This commit is contained in:
Dessalines 2024-03-14 12:34:11 -04:00
parent 91a76dc56c
commit f4bf197518
4 changed files with 10 additions and 6 deletions

View file

@ -27,7 +27,7 @@
"eslint": "^8.57.0", "eslint": "^8.57.0",
"eslint-plugin-prettier": "^5.0.1", "eslint-plugin-prettier": "^5.0.1",
"jest": "^29.5.0", "jest": "^29.5.0",
"lemmy-js-client": "0.19.4-alpha.7", "lemmy-js-client": "0.19.4-alpha.9",
"prettier": "^3.2.5", "prettier": "^3.2.5",
"ts-jest": "^29.1.0", "ts-jest": "^29.1.0",
"typescript": "^5.3.3" "typescript": "^5.3.3"

View file

@ -30,8 +30,8 @@ devDependencies:
specifier: ^29.5.0 specifier: ^29.5.0
version: 29.7.0(@types/node@20.11.22) version: 29.7.0(@types/node@20.11.22)
lemmy-js-client: lemmy-js-client:
specifier: 0.19.4-alpha.7 specifier: 0.19.4-alpha.9
version: 0.19.4-alpha.7 version: 0.19.4-alpha.9
prettier: prettier:
specifier: ^3.2.5 specifier: ^3.2.5
version: 3.2.5 version: 3.2.5
@ -2390,8 +2390,8 @@ packages:
engines: {node: '>=6'} engines: {node: '>=6'}
dev: true dev: true
/lemmy-js-client@0.19.4-alpha.7: /lemmy-js-client@0.19.4-alpha.9:
resolution: {integrity: sha512-1xvSDlhJmU3IzhT2+pvqPWKHo0P/aYTlpObL3hLy1RgaZLapvn3W7XC48cOydas+MAm2WBFsiFX9bi5X+5FWFA==} resolution: {integrity: sha512-krvrTXKji+y6huy91Qyav5e5ueKfWPKuKp6eE3OS3IEsyqsleU2drJRt0QAb8Gx/Qw+7V0y5uwWdalrKA5J78A==}
dependencies: dependencies:
cross-fetch: 4.0.0 cross-fetch: 4.0.0
form-data: 4.0.0 form-data: 4.0.0

View file

@ -72,6 +72,10 @@ test("Upload image and delete it", async () => {
// Ensure that it shows the image is deleted // Ensure that it shows the image is deleted
const deletedListMediaRes = await alphaImage.listMedia({}); const deletedListMediaRes = await alphaImage.listMedia({});
expect(deletedListMediaRes.images.length).toBe(0); 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 () => { test("Purge user, uploaded image removed", async () => {

View file

@ -342,7 +342,7 @@ pub fn config(cfg: &mut web::ServiceConfig, rate_limit: &RateLimitCell) {
"/registration_application/approve", "/registration_application/approve",
web::put().to(approve_registration_application), 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( .service(
web::scope("/purge") web::scope("/purge")
.route("/person", web::post().to(purge_person)) .route("/person", web::post().to(purge_person))