feat(session): add Ctrl+N new-session shortcut
This commit is contained in:
@@ -135,6 +135,29 @@ describe("App command progress and errors", () => {
|
||||
expect(status).toHaveTextContent("Ready for your next prompt");
|
||||
});
|
||||
|
||||
it("starts a session in selected directory with Ctrl+N", async () => {
|
||||
mocks.invoke.mockImplementation((command: string) => {
|
||||
if (command === "create_session_runtime")
|
||||
return Promise.resolve({ runtime: { runtimeId: "runtime-new" } });
|
||||
return Promise.resolve(uiState);
|
||||
});
|
||||
render(<App />);
|
||||
const event = new KeyboardEvent("keydown", {
|
||||
bubbles: true,
|
||||
cancelable: true,
|
||||
ctrlKey: true,
|
||||
key: "n",
|
||||
});
|
||||
window.dispatchEvent(event);
|
||||
|
||||
expect(event.defaultPrevented).toBe(true);
|
||||
await waitFor(() =>
|
||||
expect(mocks.invoke).toHaveBeenCalledWith("create_session_runtime", {
|
||||
worktreePath: "/repo",
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
it("loads categorized snapshot selectors and derives providers from choices", async () => {
|
||||
const user = userEvent.setup();
|
||||
const loaded: UiState = {
|
||||
|
||||
Reference in New Issue
Block a user