mirror of
https://github.com/aljazceru/claude-code-viewer.git
synced 2026-01-08 16:14:24 +01:00
chore: adjust form styles
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { Path } from "@effect/platform";
|
||||
import { Effect } from "effect";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import type { InternalEventDeclaration } from "../types/InternalEventDeclaration";
|
||||
@@ -21,6 +22,7 @@ describe("FileWatcherService", () => {
|
||||
program.pipe(
|
||||
Effect.provide(FileWatcherService.Live),
|
||||
Effect.provide(EventBus.Live),
|
||||
Effect.provide(Path.layer),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -44,6 +46,7 @@ describe("FileWatcherService", () => {
|
||||
program.pipe(
|
||||
Effect.provide(FileWatcherService.Live),
|
||||
Effect.provide(EventBus.Live),
|
||||
Effect.provide(Path.layer),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -67,6 +70,7 @@ describe("FileWatcherService", () => {
|
||||
program.pipe(
|
||||
Effect.provide(FileWatcherService.Live),
|
||||
Effect.provide(EventBus.Live),
|
||||
Effect.provide(Path.layer),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -96,6 +100,7 @@ describe("FileWatcherService", () => {
|
||||
program.pipe(
|
||||
Effect.provide(FileWatcherService.Live),
|
||||
Effect.provide(EventBus.Live),
|
||||
Effect.provide(Path.layer),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -142,6 +147,7 @@ describe("FileWatcherService", () => {
|
||||
program.pipe(
|
||||
Effect.provide(FileWatcherService.Live),
|
||||
Effect.provide(EventBus.Live),
|
||||
Effect.provide(Path.layer),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -167,6 +173,7 @@ describe("FileWatcherService", () => {
|
||||
program.pipe(
|
||||
Effect.provide(FileWatcherService.Live),
|
||||
Effect.provide(EventBus.Live),
|
||||
Effect.provide(Path.layer),
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { parseGitBranchesOutput } from "./parseGitBranchesOutput";
|
||||
import * as utils from "./utils";
|
||||
|
||||
describe("getBranches", () => {
|
||||
describe("正常系", () => {
|
||||
@@ -74,11 +73,6 @@ describe("getBranches", () => {
|
||||
it("空の結果を返す(ブランチがない場合)", async () => {
|
||||
const mockOutput = "";
|
||||
|
||||
vi.mocked(utils.executeGitCommand).mockResolvedValue({
|
||||
success: true,
|
||||
data: mockOutput,
|
||||
});
|
||||
|
||||
const result = parseGitBranchesOutput(mockOutput);
|
||||
|
||||
expect(result.success).toBe(true);
|
||||
@@ -92,11 +86,6 @@ describe("getBranches", () => {
|
||||
invalid line
|
||||
feature def5678 Feature commit`;
|
||||
|
||||
vi.mocked(utils.executeGitCommand).mockResolvedValue({
|
||||
success: true,
|
||||
data: mockOutput,
|
||||
});
|
||||
|
||||
const result = parseGitBranchesOutput(mockOutput);
|
||||
|
||||
expect(result.success).toBe(true);
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { parseGitCommitsOutput } from "./parseGitCommitsOutput";
|
||||
import * as utils from "./utils";
|
||||
|
||||
describe("getCommits", () => {
|
||||
describe("正常系", () => {
|
||||
@@ -9,11 +8,6 @@ describe("getCommits", () => {
|
||||
def456|fix: bug fix|Jane Smith|2024-01-14 09:20:00 +0900
|
||||
ghi789|chore: update deps|Bob Johnson|2024-01-13 08:10:00 +0900`;
|
||||
|
||||
vi.mocked(utils.executeGitCommand).mockResolvedValue({
|
||||
success: true,
|
||||
data: mockOutput,
|
||||
});
|
||||
|
||||
const result = parseGitCommitsOutput(mockOutput);
|
||||
|
||||
expect(result.success).toBe(true);
|
||||
@@ -42,12 +36,6 @@ ghi789|chore: update deps|Bob Johnson|2024-01-13 08:10:00 +0900`;
|
||||
|
||||
it("空の結果を返す(コミットがない場合)", async () => {
|
||||
const mockOutput = "";
|
||||
|
||||
vi.mocked(utils.executeGitCommand).mockResolvedValue({
|
||||
success: true,
|
||||
data: mockOutput,
|
||||
});
|
||||
|
||||
const result = parseGitCommitsOutput(mockOutput);
|
||||
|
||||
expect(result.success).toBe(true);
|
||||
@@ -63,11 +51,6 @@ def456|fix: bug fix|Jane Smith|2024-01-14 09:20:00 +0900
|
||||
||missing data|
|
||||
ghi789|chore: update deps|Bob Johnson|2024-01-13 08:10:00 +0900`;
|
||||
|
||||
vi.mocked(utils.executeGitCommand).mockResolvedValue({
|
||||
success: true,
|
||||
data: mockOutput,
|
||||
});
|
||||
|
||||
const result = parseGitCommitsOutput(mockOutput);
|
||||
|
||||
expect(result.success).toBe(true);
|
||||
@@ -85,11 +68,6 @@ ghi789|chore: update deps|Bob Johnson|2024-01-13 08:10:00 +0900`;
|
||||
const mockOutput = `abc123|feat: add "quotes" & <special> chars|Author Name|2024-01-15 10:30:00 +0900
|
||||
def456|fix: 日本語メッセージ|日本語 著者|2024-01-14 09:20:00 +0900`;
|
||||
|
||||
vi.mocked(utils.executeGitCommand).mockResolvedValue({
|
||||
success: true,
|
||||
data: mockOutput,
|
||||
});
|
||||
|
||||
const result = parseGitCommitsOutput(mockOutput);
|
||||
|
||||
expect(result.success).toBe(true);
|
||||
@@ -106,11 +84,6 @@ def456|fix: 日本語メッセージ|日本語 著者|2024-01-14 09:20:00 +0900`
|
||||
it("空白を含むパスでも正常に動作する", async () => {
|
||||
const mockOutput = `abc123|feat: test|Author|2024-01-15 10:30:00 +0900`;
|
||||
|
||||
vi.mocked(utils.executeGitCommand).mockResolvedValue({
|
||||
success: true,
|
||||
data: mockOutput,
|
||||
});
|
||||
|
||||
const result = parseGitCommitsOutput(mockOutput);
|
||||
|
||||
expect(result.success).toBe(true);
|
||||
@@ -126,11 +99,6 @@ def456|fix: 日本語メッセージ|日本語 著者|2024-01-14 09:20:00 +0900`
|
||||
def456|fix: bug|Author|2024-01-14 09:20:00 +0900
|
||||
`;
|
||||
|
||||
vi.mocked(utils.executeGitCommand).mockResolvedValue({
|
||||
success: true,
|
||||
data: mockOutput,
|
||||
});
|
||||
|
||||
const result = parseGitCommitsOutput(mockOutput);
|
||||
|
||||
expect(result.success).toBe(true);
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { Path } from "@effect/platform";
|
||||
import { Effect, Layer, Ref } from "effect";
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
import { EventBus } from "../core/events/services/EventBus";
|
||||
@@ -100,6 +101,7 @@ describe("InitializeService", () => {
|
||||
createMockProjectMetaService(),
|
||||
createMockSessionMetaService(),
|
||||
VirtualConversationDatabase.Live,
|
||||
Path.layer,
|
||||
);
|
||||
|
||||
// Provide dependencies to InitializeService.Live and expose all services
|
||||
@@ -158,7 +160,7 @@ describe("InitializeService", () => {
|
||||
);
|
||||
|
||||
const result = await Effect.runPromise(
|
||||
program.pipe(Effect.provide(testLayer)),
|
||||
program.pipe(Effect.provide(testLayer), Effect.provide(Path.layer)),
|
||||
);
|
||||
|
||||
expect(result).toBeUndefined();
|
||||
@@ -178,7 +180,7 @@ describe("InitializeService", () => {
|
||||
const testLayer = createTestLayer();
|
||||
|
||||
const result = await Effect.runPromise(
|
||||
program.pipe(Effect.provide(testLayer)),
|
||||
program.pipe(Effect.provide(testLayer), Effect.provide(Path.layer)),
|
||||
);
|
||||
|
||||
expect(result).toBe("file watcher started");
|
||||
@@ -217,7 +219,7 @@ describe("InitializeService", () => {
|
||||
const testLayer = createTestLayer();
|
||||
|
||||
const result = await Effect.runPromise(
|
||||
program.pipe(Effect.provide(testLayer)),
|
||||
program.pipe(Effect.provide(testLayer), Effect.provide(Path.layer)),
|
||||
);
|
||||
|
||||
expect(result).toHaveLength(1);
|
||||
@@ -251,7 +253,7 @@ describe("InitializeService", () => {
|
||||
const testLayer = createTestLayer();
|
||||
|
||||
const result = await Effect.runPromise(
|
||||
program.pipe(Effect.provide(testLayer)),
|
||||
program.pipe(Effect.provide(testLayer), Effect.provide(Path.layer)),
|
||||
);
|
||||
|
||||
// heartbeat is emitted immediately once first, then every 10 seconds
|
||||
@@ -314,7 +316,9 @@ describe("InitializeService", () => {
|
||||
mockSessionRepositoryLayer,
|
||||
);
|
||||
|
||||
await Effect.runPromise(program.pipe(Effect.provide(testLayer)));
|
||||
await Effect.runPromise(
|
||||
program.pipe(Effect.provide(testLayer), Effect.provide(Path.layer)),
|
||||
);
|
||||
|
||||
expect(getProjectsCalled).toHaveBeenCalledTimes(1);
|
||||
expect(getSessionsCalled).toHaveBeenCalledTimes(1);
|
||||
@@ -336,7 +340,9 @@ describe("InitializeService", () => {
|
||||
|
||||
// Completes without throwing error
|
||||
await expect(
|
||||
Effect.runPromise(program.pipe(Effect.provide(testLayer))),
|
||||
Effect.runPromise(
|
||||
program.pipe(Effect.provide(testLayer), Effect.provide(Path.layer)),
|
||||
),
|
||||
).resolves.toBeUndefined();
|
||||
});
|
||||
});
|
||||
@@ -353,7 +359,7 @@ describe("InitializeService", () => {
|
||||
const testLayer = createTestLayer();
|
||||
|
||||
const result = await Effect.runPromise(
|
||||
program.pipe(Effect.provide(testLayer)),
|
||||
program.pipe(Effect.provide(testLayer), Effect.provide(Path.layer)),
|
||||
);
|
||||
|
||||
expect(result).toBe("cleaned up");
|
||||
|
||||
Reference in New Issue
Block a user