chore(format): run prettier over src/ and scripts/
Formatting was configured but never enforced: `bun run format:check` reported 199 unformatted files and ran in no workflow and in no git hook, so .prettierrc (printWidth 100, trailing commas) described an intention rather than the tree. This is the one-time sweep that makes the check gateable. Whitespace and token-reflow only -- no behavioural change: `bun run check` reports 0 errors and all 1053 frontend tests pass before and after. Kept out of every other commit on purpose. A 199-file diff mixed with real changes is unreviewable, and the next commit turns format:check into a hard CI gate so this cannot silently accumulate again.
This commit is contained in:
@@ -96,7 +96,8 @@ describe("RepositoryClient", () => {
|
||||
});
|
||||
|
||||
it("should pass multiple image options to backend", async () => {
|
||||
const mockUrl = "https://server.com/Items/item123/Images/Backdrop?maxWidth=1920&maxHeight=1080&quality=90&api_key=token";
|
||||
const mockUrl =
|
||||
"https://server.com/Items/item123/Images/Backdrop?maxWidth=1920&maxHeight=1080&quality=90&api_key=token";
|
||||
(invoke as any).mockResolvedValueOnce(mockUrl);
|
||||
|
||||
const options = {
|
||||
@@ -133,9 +134,7 @@ describe("RepositoryClient", () => {
|
||||
it("should throw error if not initialized before getImageUrl", async () => {
|
||||
const newClient = new RepositoryClient();
|
||||
|
||||
await expect(newClient.getImageUrl("item123")).rejects.toThrow(
|
||||
"Repository not initialized"
|
||||
);
|
||||
await expect(newClient.getImageUrl("item123")).rejects.toThrow("Repository not initialized");
|
||||
});
|
||||
});
|
||||
|
||||
@@ -243,7 +242,7 @@ describe("RepositoryClient", () => {
|
||||
"repository_get_video_download_url",
|
||||
expect.objectContaining({
|
||||
quality,
|
||||
})
|
||||
}),
|
||||
);
|
||||
}
|
||||
});
|
||||
@@ -314,9 +313,7 @@ describe("RepositoryClient", () => {
|
||||
|
||||
it("should search with backend search command", async () => {
|
||||
const mockResult = {
|
||||
items: [
|
||||
{ id: "item1", name: "Search Result 1", type: "Audio" },
|
||||
],
|
||||
items: [{ id: "item1", name: "Search Result 1", type: "Audio" }],
|
||||
totalRecordCount: 1,
|
||||
};
|
||||
(invoke as any).mockResolvedValueOnce(mockResult);
|
||||
@@ -353,7 +350,10 @@ describe("RepositoryClient", () => {
|
||||
});
|
||||
|
||||
it("should get downloaded items with camelCase params", async () => {
|
||||
const mockResult = { items: [{ id: "t1", name: "Track", type: "Audio" }], totalRecordCount: 1 };
|
||||
const mockResult = {
|
||||
items: [{ id: "t1", name: "Track", type: "Audio" }],
|
||||
totalRecordCount: 1,
|
||||
};
|
||||
(invoke as any).mockResolvedValueOnce(mockResult);
|
||||
|
||||
const result = await client.getDownloadedItems("album1", { limit: 50 });
|
||||
@@ -367,7 +367,12 @@ describe("RepositoryClient", () => {
|
||||
});
|
||||
|
||||
it("should get download disk usage from backend", async () => {
|
||||
const mockUsage = { sizes: { t1: 1000 }, partialContainers: {}, deviceTotalBytes: 1000, itemCount: 1 };
|
||||
const mockUsage = {
|
||||
sizes: { t1: 1000 },
|
||||
partialContainers: {},
|
||||
deviceTotalBytes: 1000,
|
||||
itemCount: 1,
|
||||
};
|
||||
(invoke as any).mockResolvedValueOnce(mockUsage);
|
||||
|
||||
const usage = await client.getDownloadDiskUsage();
|
||||
@@ -589,7 +594,9 @@ describe("RepositoryClient", () => {
|
||||
|
||||
it("should throw error if not initialized before playlist operations", async () => {
|
||||
const newClient = new RepositoryClient();
|
||||
await expect(newClient.getPlaylistItems("pl-1")).rejects.toThrow("Repository not initialized");
|
||||
await expect(newClient.getPlaylistItems("pl-1")).rejects.toThrow(
|
||||
"Repository not initialized",
|
||||
);
|
||||
await expect(newClient.createPlaylist("test")).rejects.toThrow("Repository not initialized");
|
||||
await expect(newClient.deletePlaylist("pl-1")).rejects.toThrow("Repository not initialized");
|
||||
});
|
||||
@@ -599,9 +606,9 @@ describe("RepositoryClient", () => {
|
||||
it("should throw error if invoke fails", async () => {
|
||||
(invoke as any).mockRejectedValueOnce(new Error("Network error"));
|
||||
|
||||
await expect(client.create("https://server.com", "user1", "token", "server1")).rejects.toThrow(
|
||||
"Network error"
|
||||
);
|
||||
await expect(
|
||||
client.create("https://server.com", "user1", "token", "server1"),
|
||||
).rejects.toThrow("Network error");
|
||||
});
|
||||
|
||||
it("should handle missing optional parameters", async () => {
|
||||
@@ -616,7 +623,7 @@ describe("RepositoryClient", () => {
|
||||
"repository_get_image_url",
|
||||
expect.objectContaining({
|
||||
options: null,
|
||||
})
|
||||
}),
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user