@@ -13,19 +13,10 @@ import { flushdb } from "@server/test/support";
|
||||
|
||||
const app = webService();
|
||||
const server = new TestServer(app.callback());
|
||||
jest.mock("aws-sdk", () => {
|
||||
const mS3 = {
|
||||
createPresignedPost: jest.fn(),
|
||||
deleteObject: jest.fn().mockReturnThis(),
|
||||
promise: jest.fn(),
|
||||
};
|
||||
return {
|
||||
S3: jest.fn(() => mS3),
|
||||
Endpoint: jest.fn(),
|
||||
};
|
||||
});
|
||||
|
||||
beforeEach(() => flushdb());
|
||||
afterAll(() => server.close());
|
||||
|
||||
describe("#fileOperations.info", () => {
|
||||
it("should return fileOperation", async () => {
|
||||
const team = await buildTeam();
|
||||
@@ -73,6 +64,7 @@ describe("#fileOperations.info", () => {
|
||||
expect(res.status).toEqual(403);
|
||||
});
|
||||
});
|
||||
|
||||
describe("#fileOperations.list", () => {
|
||||
it("should return fileOperations list", async () => {
|
||||
const team = await buildTeam();
|
||||
@@ -212,6 +204,7 @@ describe("#fileOperations.list", () => {
|
||||
expect(res.status).toEqual(403);
|
||||
});
|
||||
});
|
||||
|
||||
describe("#fileOperations.redirect", () => {
|
||||
it("should not redirect when file operation is not complete", async () => {
|
||||
const team = await buildTeam();
|
||||
@@ -234,6 +227,7 @@ describe("#fileOperations.redirect", () => {
|
||||
expect(body.message).toEqual("export is not complete yet");
|
||||
});
|
||||
});
|
||||
|
||||
describe("#fileOperations.info", () => {
|
||||
it("should return file operation", async () => {
|
||||
const team = await buildTeam();
|
||||
@@ -279,6 +273,7 @@ describe("#fileOperations.info", () => {
|
||||
expect(res.status).toBe(403);
|
||||
});
|
||||
});
|
||||
|
||||
describe("#fileOperations.delete", () => {
|
||||
it("should delete file operation", async () => {
|
||||
const team = await buildTeam();
|
||||
|
||||
Reference in New Issue
Block a user