stash
This commit is contained in:
31
server/commands/documentBatchImporter.test.js
Normal file
31
server/commands/documentBatchImporter.test.js
Normal file
@ -0,0 +1,31 @@
|
||||
// @flow
|
||||
import path from "path";
|
||||
import File from "formidable/lib/file";
|
||||
import { buildUser } from "../test/factories";
|
||||
import { flushdb } from "../test/support";
|
||||
import documentBatchImporter from "./documentBatchImporter";
|
||||
|
||||
jest.mock("../utils/s3");
|
||||
|
||||
beforeEach(() => flushdb());
|
||||
|
||||
describe("documentBatchImporter", () => {
|
||||
const ip = "127.0.0.1";
|
||||
|
||||
it("should import documents in outline format", async () => {
|
||||
const user = await buildUser();
|
||||
const name = "outline.zip";
|
||||
const file = new File({
|
||||
name,
|
||||
type: "application/zip",
|
||||
path: path.resolve(__dirname, "..", "test", "fixtures", name),
|
||||
});
|
||||
|
||||
await documentBatchImporter({
|
||||
type: "outline",
|
||||
user,
|
||||
file,
|
||||
ip,
|
||||
});
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user