closes #1784
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/* eslint-disable flowtype/require-valid-file-annotation */
|
||||
import { buildDocument, buildCollection } from "../test/factories";
|
||||
// @flow
|
||||
import { buildDocument, buildCollection, buildUser } from "../test/factories";
|
||||
import { flushdb, seed } from "../test/support";
|
||||
import documentMover from "./documentMover";
|
||||
|
||||
@@ -22,6 +22,23 @@ describe("documentMover", () => {
|
||||
expect(response.documents.length).toEqual(1);
|
||||
});
|
||||
|
||||
it("should not error when not in source collection documentStructure", async () => {
|
||||
const user = await buildUser();
|
||||
const collection = await buildCollection({ teamId: user.teamId });
|
||||
const document = await buildDocument({ collectionId: collection.id });
|
||||
await document.archive();
|
||||
|
||||
const response = await documentMover({
|
||||
user,
|
||||
document,
|
||||
collectionId: collection.id,
|
||||
ip,
|
||||
});
|
||||
|
||||
expect(response.collections.length).toEqual(1);
|
||||
expect(response.documents.length).toEqual(1);
|
||||
});
|
||||
|
||||
it("should move with children", async () => {
|
||||
const { document, user, collection } = await seed();
|
||||
const newDocument = await buildDocument({
|
||||
|
||||
Reference in New Issue
Block a user