mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 22:00:44 +00:00
fix(webchat): create dashboard sessions from New Chat
This commit is contained in:
@@ -130,6 +130,8 @@ function createChatSessionState(overrides: Partial<AppViewState> = {}) {
|
||||
chatStreamStartedAt: null,
|
||||
connected: true,
|
||||
client: { request: vi.fn() },
|
||||
sessionsLoading: false,
|
||||
sessionsError: null,
|
||||
sessionsResult: {
|
||||
ts: 0,
|
||||
path: "",
|
||||
@@ -634,6 +636,22 @@ describe("createChatSession", () => {
|
||||
"Session list is still refreshing. Try New Chat again in a moment.",
|
||||
);
|
||||
});
|
||||
|
||||
it("shows retry feedback when creation is skipped without a session error", async () => {
|
||||
const state = createChatSessionState({ lastError: "previous error" });
|
||||
createSessionAndRefreshMock.mockResolvedValue(null);
|
||||
|
||||
await createChatSession(state);
|
||||
|
||||
expect(createSessionAndRefreshMock).toHaveBeenCalledTimes(1);
|
||||
expect(state.sessionKey).toBe("agent:ops:main");
|
||||
expect(state.chatMessage).toBe("draft prompt");
|
||||
expect(state.sessionsError).toBeNull();
|
||||
expect(state.lastError).toBe(
|
||||
"Session list is still refreshing. Try New Chat again in a moment.",
|
||||
);
|
||||
expect(loadChatHistoryMock).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
||||
describe("switchChatSession", () => {
|
||||
|
||||
Reference in New Issue
Block a user