forked from zadam/trilium
-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #173 from TriliumNext/feat/ts-unit-and-integration…
…-tests feat: TS unit and integration tests
- Loading branch information
Showing
31 changed files
with
1,814 additions
and
1,700 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import etapi = require("../support/etapi"); | ||
|
||
etapi.describeEtapi("app_info", () => { | ||
it("get", async () => { | ||
const appInfo = await etapi.getEtapi("app-info"); | ||
expect(appInfo.clipperProtocolVersion).toEqual("1.0"); | ||
}); | ||
}); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import etapi = require("../support/etapi"); | ||
|
||
etapi.describeEtapi("backup", () => { | ||
it("create", async () => { | ||
const response = await etapi.putEtapiContent("backup/etapi_test"); | ||
expect(response.status).toEqual(204); | ||
}); | ||
}); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import etapi = require("../support/etapi"); | ||
import fs = require("fs"); | ||
import path = require("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"); | ||
}); | ||
}); |
Oops, something went wrong.