fix: Server error when rendering share for deleted document
closes #2352
This commit is contained in:
@@ -28,6 +28,19 @@ describe("/share/:id", () => {
|
||||
expect(body).toContain("<title>Outline</title>");
|
||||
});
|
||||
|
||||
it("should return standard title in html when document is deleted", async () => {
|
||||
const document = await buildDocument();
|
||||
const share = await buildShare({ documentId: document.id });
|
||||
|
||||
await document.destroy();
|
||||
|
||||
const res = await server.get(`/share/${share.id}`);
|
||||
const body = await res.text();
|
||||
|
||||
expect(res.status).toEqual(200);
|
||||
expect(body).toContain("<title>Outline</title>");
|
||||
});
|
||||
|
||||
it("should return document title in html when loading published share", async () => {
|
||||
const document = await buildDocument();
|
||||
const share = await buildShare({ documentId: document.id });
|
||||
|
||||
Reference in New Issue
Block a user