fix: Improve validation on documents.import endpoint

This commit is contained in:
Tom Moor
2020-11-26 20:29:45 -08:00
parent 56d5f048f9
commit 8bddc1b338
2 changed files with 17 additions and 0 deletions

View File

@ -1524,6 +1524,18 @@ describe("#documents.unstar", () => {
});
});
describe("#documents.import", () => {
it("should error if no file is passed", async () => {
const user = await buildUser();
const res = await server.post("/api/documents.import", {
body: {
token: user.getJwtToken(),
},
});
expect(res.status).toEqual(400);
});
});
describe("#documents.create", () => {
it("should create as a new document", async () => {
const { user, collection } = await seed();