mirror of
https://github.com/TriliumNext/Notes.git
synced 2026-01-06 04:50:03 -06:00
fix(test): tests that got broken along the way
This commit is contained in:
@@ -27,6 +27,7 @@ describe("Share API test", () => {
|
||||
it("requests password for password-protected share", async () => {
|
||||
await supertest(app)
|
||||
.get("/share/YjlPRj2E9fOV")
|
||||
.expect(200)
|
||||
.expect("WWW-Authenticate", 'Basic realm="User Visible Realm", charset="UTF-8"');
|
||||
expect(cannotSetHeadersCount).toBe(0);
|
||||
});
|
||||
|
||||
@@ -131,6 +131,7 @@ function renderImageAttachment(image: SNote, res: Response, attachmentName: stri
|
||||
function register(router: Router) {
|
||||
function renderNote(note: SNote, req: Request, res: Response) {
|
||||
if (!note) {
|
||||
console.log("Unable to find note ", note);
|
||||
res.status(404).render("share/404");
|
||||
return;
|
||||
}
|
||||
@@ -215,6 +216,7 @@ function register(router: Router) {
|
||||
|
||||
const { shareId } = req.params;
|
||||
|
||||
console.log("Got share ", shareId, shaca.notes, shaca.aliasToNote);
|
||||
const note = shaca.aliasToNote[shareId] || shaca.notes[shareId];
|
||||
|
||||
renderNote(note, req, res);
|
||||
|
||||
Reference in New Issue
Block a user