mirror of
https://github.com/zadam/trilium.git
synced 2025-11-02 03:16:11 +01:00
Merge remote-tracking branch 'origin/develop' into feature/server_esm
This commit is contained in:
28
spec/etapi/import.ts
Normal file
28
spec/etapi/import.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import etapi from "../support/etapi.js";
|
||||
import fs from "fs";
|
||||
import path from "path";
|
||||
|
||||
etapi.describeEtapi("import", () => {
|
||||
// temporarily skip this test since test-export.zip is missing
|
||||
xit("import", async () => {
|
||||
const zipFileBuffer = fs.readFileSync(
|
||||
path.resolve(__dirname, "test-export.zip")
|
||||
);
|
||||
|
||||
const response = await etapi.postEtapiContent(
|
||||
"notes/root/import",
|
||||
zipFileBuffer
|
||||
);
|
||||
expect(response.status).toEqual(201);
|
||||
|
||||
const { note, branch } = await response.json();
|
||||
|
||||
expect(note.title).toEqual("test-export");
|
||||
expect(branch.parentNoteId).toEqual("root");
|
||||
|
||||
const content = await (
|
||||
await etapi.getEtapiContent(`notes/${note.noteId}/content`)
|
||||
).text();
|
||||
expect(content).toContain("test export content");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user