story-211: skip selection screen when CLI path argument provided
When a project path is passed on the command line, skip the project selection screen in the frontend and go straight to the main UI. Squash merge of feature/story-211 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -57,6 +57,7 @@ describe("App", () => {
|
||||
beforeEach(() => {
|
||||
vi.resetModules();
|
||||
vi.clearAllMocks();
|
||||
mockedApi.getCurrentProject.mockResolvedValue(null);
|
||||
mockedApi.getKnownProjects.mockResolvedValue([]);
|
||||
mockedApi.getHomeDirectory.mockResolvedValue("/home/user");
|
||||
mockedApi.listDirectoryAbsolute.mockResolvedValue([]);
|
||||
@@ -71,6 +72,26 @@ describe("App", () => {
|
||||
return render(<App />);
|
||||
}
|
||||
|
||||
it("calls getCurrentProject() on mount", async () => {
|
||||
await renderApp();
|
||||
|
||||
await waitFor(() => {
|
||||
expect(mockedApi.getCurrentProject).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
});
|
||||
|
||||
it("skips selection screen and shows workspace when server already has a project open", async () => {
|
||||
mockedApi.getCurrentProject.mockResolvedValue("/home/user/myproject");
|
||||
|
||||
await renderApp();
|
||||
|
||||
await waitFor(() => {
|
||||
expect(
|
||||
screen.queryByPlaceholderText(/\/path\/to\/project/i),
|
||||
).not.toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
it("renders the selection screen when no project is open", async () => {
|
||||
await renderApp();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user