mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-26 14:21:19 +00:00
Dont use test.png image for api tests (#4254)
This commit is contained in:
parent
c7ee53026f
commit
e0e74e50ae
1 changed files with 5 additions and 5 deletions
|
@ -18,7 +18,6 @@ import {
|
||||||
setupLogins,
|
setupLogins,
|
||||||
unfollowRemotes,
|
unfollowRemotes,
|
||||||
} from "./shared";
|
} from "./shared";
|
||||||
import * as fs from "node:fs";
|
|
||||||
const downloadFileSync = require("download-file-sync");
|
const downloadFileSync = require("download-file-sync");
|
||||||
|
|
||||||
beforeAll(setupLogins);
|
beforeAll(setupLogins);
|
||||||
|
@ -28,8 +27,9 @@ afterAll(() => {
|
||||||
});
|
});
|
||||||
|
|
||||||
test("Upload image and delete it", async () => {
|
test("Upload image and delete it", async () => {
|
||||||
// upload test image
|
// Upload test image. We use a simple string buffer as pictrs doesnt require an actual image
|
||||||
const upload_image = fs.readFileSync("test.png");
|
// in testing mode.
|
||||||
|
const upload_image = Buffer.from("test");
|
||||||
const upload_form: UploadImage = {
|
const upload_form: UploadImage = {
|
||||||
image: upload_image,
|
image: upload_image,
|
||||||
};
|
};
|
||||||
|
@ -60,7 +60,7 @@ test("Purge user, uploaded image removed", async () => {
|
||||||
let user = await registerUser(alphaImage, alphaUrl);
|
let user = await registerUser(alphaImage, alphaUrl);
|
||||||
|
|
||||||
// upload test image
|
// upload test image
|
||||||
const upload_image = fs.readFileSync("test.png");
|
const upload_image = Buffer.from("test");
|
||||||
const upload_form: UploadImage = {
|
const upload_form: UploadImage = {
|
||||||
image: upload_image,
|
image: upload_image,
|
||||||
};
|
};
|
||||||
|
@ -91,7 +91,7 @@ test("Purge post, linked image removed", async () => {
|
||||||
let user = await registerUser(beta, betaUrl);
|
let user = await registerUser(beta, betaUrl);
|
||||||
|
|
||||||
// upload test image
|
// upload test image
|
||||||
const upload_image = fs.readFileSync("test.png");
|
const upload_image = Buffer.from("test");
|
||||||
const upload_form: UploadImage = {
|
const upload_form: UploadImage = {
|
||||||
image: upload_image,
|
image: upload_image,
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue