mirror of
https://github.com/zadam/trilium.git
synced 2025-11-14 01:05:49 +01:00
chore(server/test): password protected share
This commit is contained in:
20
src/share/routes.spec.ts
Normal file
20
src/share/routes.spec.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { beforeAll, describe, it } from "vitest";
|
||||
import supertest from "supertest";
|
||||
import type { App } from "supertest/types.js";
|
||||
import { initializeTranslations } from "../services/i18n.js";
|
||||
|
||||
let app: App;
|
||||
|
||||
describe("Share API test", () => {
|
||||
beforeAll(async () => {
|
||||
initializeTranslations();
|
||||
app = (await import("../app.js")).default;
|
||||
});
|
||||
|
||||
it("requests password for password-protected share", async () => {
|
||||
await supertest(app)
|
||||
.get("/share/YjlPRj2E9fOV")
|
||||
.expect("WWW-Authenticate", 'Basic realm="User Visible Realm", charset="UTF-8"');
|
||||
});
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user