fix: keep RunSetup reachable with zero lanes, fix snapshot handling
Fixes regression from Tasks 1-2: 1. Run.defaultCwd.test.tsx was failing because LaneConsolePane wasn't rendering when no lane was selected (in layout-1 with zero lanes). 2. Added fallback rendering of LaneConsolePane in Workspace when !currentLane, so RunSetup stays reachable on fresh install. 3. Fixed early-return condition in LaneConsolePane to only show dropdown-only placeholder when showLaneSelector=true && laneId=null (split-view mode), not in layout-1 mode. 4. Added useEffect to sync cwd state with defaultCwd when it changes asynchronously from parent. 5. Updated LaneConsolePane tests to reflect correct behavior. 6. Regenerated snapshot to match layout-1 output.
This commit is contained in:
@@ -132,16 +132,16 @@ describe("LaneConsolePane", () => {
|
||||
expect(screen.queryByTestId("pane-lane-select")).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("renders an empty placeholder when laneId is null and showLaneSelector is false", () => {
|
||||
it("renders RunSetup when laneId is null and showLaneSelector is false (layout-1, fresh install)", () => {
|
||||
render(<LaneConsolePane {...baseProps()} laneId={null} showLaneSelector={false} />);
|
||||
expect(screen.getByTestId("pane-empty")).toBeInTheDocument();
|
||||
expect(screen.queryByTestId("console-body")).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("renders the full console with selector when laneId is null but showLaneSelector is true", () => {
|
||||
render(<LaneConsolePane {...baseProps()} laneId={null} showLaneSelector={true} />);
|
||||
expect(screen.getByTestId("console-body")).toBeInTheDocument();
|
||||
expect(screen.getByTestId("pane-lane-select")).toBeInTheDocument();
|
||||
expect(screen.queryByTestId("pane-empty")).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("renders an empty placeholder with selector when laneId is null but showLaneSelector is true (split-view)", () => {
|
||||
render(<LaneConsolePane {...baseProps()} laneId={null} showLaneSelector={true} />);
|
||||
expect(screen.getByTestId("pane-empty")).toBeInTheDocument();
|
||||
expect(screen.getByTestId("pane-lane-select")).toBeInTheDocument();
|
||||
expect(screen.queryByTestId("console-body")).not.toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user