Skip to content

Commit 781b6da

Browse files
committed
test(ci): fix git panel and context deep link tauri listen tests
1 parent e8ad3e6 commit 781b6da

File tree

4 files changed

+13
-11
lines changed

4 files changed

+13
-11
lines changed

src/components/cortex/__tests__/CortexGitPanel.test.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -228,13 +228,13 @@ describe("CortexGitPanel", () => {
228228
describe("Commit Message Input", () => {
229229
it("should have a commit message input with placeholder", () => {
230230
const { container } = render(() => <CortexGitPanel />);
231-
const input = container.querySelector("input[placeholder*='Commit message']") as HTMLInputElement;
231+
const input = container.querySelector("textarea[placeholder*='Commit message']") as HTMLTextAreaElement;
232232
expect(input).toBeTruthy();
233233
});
234234

235235
it("should update commit message on input", async () => {
236236
const { container } = render(() => <CortexGitPanel />);
237-
const input = container.querySelector("input[placeholder*='Commit message']") as HTMLInputElement;
237+
const input = container.querySelector("textarea[placeholder*='Commit message']") as HTMLTextAreaElement;
238238
expect(input).toBeTruthy();
239239

240240
await fireEvent.input(input, { target: { value: "fix: update tests" } });
@@ -253,7 +253,7 @@ describe("CortexGitPanel", () => {
253253
);
254254

255255
const { container } = render(() => <CortexGitPanel />);
256-
const input = container.querySelector("input[placeholder*='Commit message']") as HTMLInputElement;
256+
const input = container.querySelector("textarea[placeholder*='Commit message']") as HTMLTextAreaElement;
257257
await fireEvent.input(input, { target: { value: "feat: add feature" } });
258258

259259
const commitButton = Array.from(container.querySelectorAll("button")).find(
@@ -286,7 +286,7 @@ describe("CortexGitPanel", () => {
286286
mockMultiRepo.activeRepository.mockReturnValue(createMockRepo());
287287

288288
const { container } = render(() => <CortexGitPanel />);
289-
const input = container.querySelector("input[placeholder*='Commit message']") as HTMLInputElement;
289+
const input = container.querySelector("textarea[placeholder*='Commit message']") as HTMLTextAreaElement;
290290
await fireEvent.input(input, { target: { value: "some message" } });
291291

292292
const commitButton = Array.from(container.querySelectorAll("button")).find(
@@ -306,7 +306,7 @@ describe("CortexGitPanel", () => {
306306
);
307307

308308
const { container } = render(() => <CortexGitPanel />);
309-
const input = container.querySelector("input[placeholder*='Commit message']") as HTMLInputElement;
309+
const input = container.querySelector("textarea[placeholder*='Commit message']") as HTMLTextAreaElement;
310310
await fireEvent.input(input, { target: { value: "feat: something" } });
311311

312312
const commitButton = Array.from(container.querySelectorAll("button")).find(
@@ -656,13 +656,13 @@ describe("CortexGitPanel", () => {
656656
it("should change placeholder when amend is toggled", async () => {
657657
const { container } = render(() => <CortexGitPanel />);
658658

659-
let input = container.querySelector("input[placeholder*='Commit message']") as HTMLInputElement;
659+
let input = container.querySelector("textarea[placeholder*='Commit message']") as HTMLTextAreaElement;
660660
expect(input).toBeTruthy();
661661

662662
const amendCheckbox = container.querySelector("input[type='checkbox']") as HTMLInputElement;
663663
await fireEvent.click(amendCheckbox);
664664

665-
const amendInput = container.querySelector("input[placeholder*='Amend commit message']") as HTMLInputElement;
665+
const amendInput = container.querySelector("textarea[placeholder*='Amend commit message']") as HTMLTextAreaElement;
666666
expect(amendInput).toBeTruthy();
667667
});
668668
});
@@ -805,7 +805,7 @@ describe("CortexGitPanel", () => {
805805
);
806806

807807
const { container } = render(() => <CortexGitPanel />);
808-
const input = container.querySelector("input[placeholder*='Commit message']") as HTMLInputElement;
808+
const input = container.querySelector("textarea[placeholder*='Commit message']") as HTMLTextAreaElement;
809809
await fireEvent.input(input, { target: { value: "feat: shortcut commit" } });
810810

811811
await fireEvent.keyDown(input, { key: "Enter", ctrlKey: true });

src/components/cortex/titlebar/__tests__/TitleBarDropdownMenu.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ describe("TitleBarDropdownMenu", () => {
9999
expect(style).toContain("min-width:243px");
100100
expect(style).toContain("var(--cortex-bg-secondary)");
101101
expect(style).toContain("border-radius:8px");
102-
expect(style).toContain("z-index:9999");
102+
expect(style).toContain("z-index:var(--cortex-z-dropdown)");
103103
});
104104

105105
it("should have correct item button styles", () => {

src/context/__tests__/SDKContext.approvals.test.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@ vi.mock("@tauri-apps/api/core", () => ({
1212
invoke: sdkHarness.invokeMock,
1313
}));
1414

15-
vi.mock("../../hooks", () => ({
15+
vi.mock("../../hooks/useTauriListen", () => ({
1616
useTauriListen: (_event: string, handler: (payload: Record<string, unknown>) => void) => {
1717
sdkHarness.eventHandler = handler;
18+
return Promise.resolve(() => {});
1819
},
1920
}));
2021

src/utils/__tests__/deepLink.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,10 @@ describe("deepLink", () => {
4646
openSettings,
4747
});
4848

49-
expect(mockOpenWorkspaceSurface).toHaveBeenCalledWith("/workspace/demo-project", {
49+
expect(openWorkspace).toHaveBeenCalledWith("/workspace/demo-project", {
5050
pathname: "/welcome",
5151
navigate,
52+
newWindow: undefined,
5253
});
5354
expect(info).toHaveBeenCalledWith("Opening: demo-project");
5455
expect(openFile).not.toHaveBeenCalled();

0 commit comments

Comments
 (0)