Skip to content

Commit a6c5174

Browse files
committed
refactor: Standardize code style and remove unnecessary semicolons in test file
1 parent 5fddf36 commit a6c5174

File tree

1 file changed

+47
-47
lines changed

1 file changed

+47
-47
lines changed
Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,51 @@
1-
import { expect } from "vitest";
2-
import { bulkActionHandlers } from "../../src/handlers/bulk-action-handlers.js";
3-
import { server } from "../msw-setup.js";
1+
import { expect, vi } from "vitest"
2+
import { bulkActionHandlers } from "../../src/handlers/bulk-action-handlers.js"
3+
import { server } from "../msw-setup.js"
44

55
describe("Bulk Action Handlers Integration Tests", () => {
66
// Start MSW Server before tests
7-
beforeAll(() => server.listen());
8-
afterEach(() => server.resetHandlers());
9-
afterAll(() => server.close());
7+
beforeAll(() => server.listen())
8+
afterEach(() => server.resetHandlers())
9+
afterAll(() => server.close())
1010

11-
const testSpaceId = "test-space-id";
12-
const testEnvironmentId = "master";
13-
const testEntryId = "test-entry-id";
14-
const testAssetId = "test-asset-id";
11+
const testSpaceId = "test-space-id"
12+
const testEnvironmentId = "master"
13+
const testEntryId = "test-entry-id"
14+
const testAssetId = "test-asset-id"
1515

1616
// Mock the getContentfulClient function to avoid actual API calls
1717
vi.mock("../../src/config/client.js", () => ({
1818
getContentfulClient: vi.fn().mockResolvedValue({
1919
entry: {
2020
get: vi.fn().mockResolvedValue({
21-
sys: { id: testEntryId, version: 1 }
22-
})
21+
sys: { id: testEntryId, version: 1 },
22+
}),
2323
},
2424
asset: {
2525
get: vi.fn().mockResolvedValue({
26-
sys: { id: testAssetId, version: 1 }
27-
})
26+
sys: { id: testAssetId, version: 1 },
27+
}),
2828
},
2929
bulkAction: {
3030
publish: vi.fn().mockResolvedValue({
31-
sys: { id: "test-bulk-action-id", status: "created" }
31+
sys: { id: "test-bulk-action-id", status: "created" },
3232
}),
3333
unpublish: vi.fn().mockResolvedValue({
34-
sys: { id: "test-bulk-action-id", status: "created" }
34+
sys: { id: "test-bulk-action-id", status: "created" },
3535
}),
3636
validate: vi.fn().mockResolvedValue({
37-
sys: { id: "test-bulk-action-id", status: "created" }
37+
sys: { id: "test-bulk-action-id", status: "created" },
3838
}),
3939
get: vi.fn().mockResolvedValue({
4040
sys: { id: "test-bulk-action-id", status: "succeeded" },
4141
succeeded: [
4242
{ sys: { id: testEntryId, type: "Entry" } },
43-
{ sys: { id: testAssetId, type: "Asset" } }
44-
]
45-
})
46-
}
47-
})
48-
}));
43+
{ sys: { id: testAssetId, type: "Asset" } },
44+
],
45+
}),
46+
},
47+
}),
48+
}))
4949

5050
describe("bulkPublish", () => {
5151
it("should publish multiple entries and assets", async () => {
@@ -54,15 +54,15 @@ describe("Bulk Action Handlers Integration Tests", () => {
5454
environmentId: testEnvironmentId,
5555
entities: [
5656
{ sys: { id: testEntryId, type: "Entry" } },
57-
{ sys: { id: testAssetId, type: "Asset" } }
58-
]
59-
});
57+
{ sys: { id: testAssetId, type: "Asset" } },
58+
],
59+
})
6060

61-
expect(result).to.have.property("content").that.is.an("array");
62-
expect(result.content[0].text).to.include("Bulk publish completed");
63-
expect(result.content[0].text).to.include("Successfully processed");
64-
});
65-
});
61+
expect(result).to.have.property("content").that.is.an("array")
62+
expect(result.content[0].text).to.include("Bulk publish completed")
63+
expect(result.content[0].text).to.include("Successfully processed")
64+
})
65+
})
6666

6767
describe("bulkUnpublish", () => {
6868
it("should unpublish multiple entries and assets", async () => {
@@ -71,27 +71,27 @@ describe("Bulk Action Handlers Integration Tests", () => {
7171
environmentId: testEnvironmentId,
7272
entities: [
7373
{ sys: { id: testEntryId, type: "Entry" } },
74-
{ sys: { id: testAssetId, type: "Asset" } }
75-
]
76-
});
74+
{ sys: { id: testAssetId, type: "Asset" } },
75+
],
76+
})
7777

78-
expect(result).to.have.property("content").that.is.an("array");
79-
expect(result.content[0].text).to.include("Bulk unpublish completed");
80-
expect(result.content[0].text).to.include("Successfully processed");
81-
});
82-
});
78+
expect(result).to.have.property("content").that.is.an("array")
79+
expect(result.content[0].text).to.include("Bulk unpublish completed")
80+
expect(result.content[0].text).to.include("Successfully processed")
81+
})
82+
})
8383

8484
describe("bulkValidate", () => {
8585
it("should validate multiple entries", async () => {
8686
const result = await bulkActionHandlers.bulkValidate({
8787
spaceId: testSpaceId,
8888
environmentId: testEnvironmentId,
89-
entryIds: [testEntryId]
90-
});
89+
entryIds: [testEntryId],
90+
})
9191

92-
expect(result).to.have.property("content").that.is.an("array");
93-
expect(result.content[0].text).to.include("Bulk validation completed");
94-
expect(result.content[0].text).to.include("Successfully validated");
95-
});
96-
});
97-
});
92+
expect(result).to.have.property("content").that.is.an("array")
93+
expect(result.content[0].text).to.include("Bulk validation completed")
94+
expect(result.content[0].text).to.include("Successfully validated")
95+
})
96+
})
97+
})

0 commit comments

Comments
 (0)