mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 09:40:43 +00:00
test: share app render settings fixture
This commit is contained in:
@@ -69,6 +69,26 @@ function labelsForSessionOptions(params: {
|
||||
return groups.flatMap((group) => group.options.map((option) => option.label));
|
||||
}
|
||||
|
||||
function createSettings(): AppViewState["settings"] {
|
||||
return {
|
||||
gatewayUrl: "",
|
||||
token: "",
|
||||
locale: "en",
|
||||
sessionKey: "main",
|
||||
lastActiveSessionKey: "main",
|
||||
theme: "claw",
|
||||
themeMode: "dark",
|
||||
splitRatio: 0.6,
|
||||
navWidth: 280,
|
||||
navCollapsed: false,
|
||||
navGroupsCollapsed: {},
|
||||
borderRadius: 50,
|
||||
chatFocusMode: false,
|
||||
chatShowThinking: false,
|
||||
chatShowToolCalls: true,
|
||||
};
|
||||
}
|
||||
|
||||
/* ================================================================
|
||||
* parseSessionKey – low-level key → type / fallback mapping
|
||||
* ================================================================ */
|
||||
@@ -461,23 +481,7 @@ describe("resolveSessionOptionGroups", () => {
|
||||
|
||||
describe("switchChatSession", () => {
|
||||
it("refreshes the chat avatar after clearing session-scoped state", async () => {
|
||||
const settings: AppViewState["settings"] = {
|
||||
gatewayUrl: "",
|
||||
token: "",
|
||||
locale: "en",
|
||||
sessionKey: "main",
|
||||
lastActiveSessionKey: "main",
|
||||
theme: "claw",
|
||||
themeMode: "dark",
|
||||
splitRatio: 0.6,
|
||||
navWidth: 280,
|
||||
navCollapsed: false,
|
||||
navGroupsCollapsed: {},
|
||||
borderRadius: 50,
|
||||
chatFocusMode: false,
|
||||
chatShowThinking: false,
|
||||
chatShowToolCalls: true,
|
||||
};
|
||||
const settings = createSettings();
|
||||
const state = {
|
||||
sessionKey: "main",
|
||||
chatMessage: "draft",
|
||||
@@ -538,23 +542,7 @@ describe("switchChatSession", () => {
|
||||
});
|
||||
|
||||
it("does not force agentId=main for plain session keys", async () => {
|
||||
const settings: AppViewState["settings"] = {
|
||||
gatewayUrl: "",
|
||||
token: "",
|
||||
locale: "en",
|
||||
sessionKey: "main",
|
||||
lastActiveSessionKey: "main",
|
||||
theme: "claw",
|
||||
themeMode: "dark",
|
||||
splitRatio: 0.6,
|
||||
navWidth: 280,
|
||||
navCollapsed: false,
|
||||
navGroupsCollapsed: {},
|
||||
borderRadius: 50,
|
||||
chatFocusMode: false,
|
||||
chatShowThinking: false,
|
||||
chatShowToolCalls: true,
|
||||
};
|
||||
const settings = createSettings();
|
||||
const state = {
|
||||
sessionKey: "main",
|
||||
chatMessage: "",
|
||||
|
||||
Reference in New Issue
Block a user