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-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"

View file

@ -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

View file

@ -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 () => {

View file

@ -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))