fix: attempt to pass / e2e/_output/tests/GUI.test.js test

This commit is contained in:
QiuYang Shen 2025-07-19 11:50:12 +08:00
parent c9397726aa
commit f6359bd636
2 changed files with 6 additions and 3 deletions

View file

@ -287,6 +287,9 @@ describe("GUI Test", () => {
}).timeout(DEFAULT_TIMEOUT.MD);
it("should render tool call", async () => {
// all tool's toolSettings here defaults to allowedWithPermission, which means Ask first
await GUIActions.toggleToolPolicy(view, "view_diff", 1);
const [messageInput] = await GUISelectors.getMessageInputFields(view);
await messageInput.sendKeys("Hello");
await messageInput.sendKeys(Key.ENTER);
@ -304,7 +307,7 @@ describe("GUI Test", () => {
}).timeout(DEFAULT_TIMEOUT.MD * 100);
it("should call tool after approval", async () => {
await GUIActions.toggleToolPolicy(view, "view_diff", 2);
// await GUIActions.toggleToolPolicy(view, "view_diff", 2);
const [messageInput] = await GUISelectors.getMessageInputFields(view);
await messageInput.sendKeys("Hello");
@ -325,7 +328,7 @@ describe("GUI Test", () => {
}).timeout(DEFAULT_TIMEOUT.XL);
it("should cancel tool", async () => {
await GUIActions.toggleToolPolicy(view, "view_diff", 2);
// await GUIActions.toggleToolPolicy(view, "view_diff", 2);
const [messageInput] = await GUISelectors.getMessageInputFields(view);
await messageInput.sendKeys("Hello");

View file

@ -90,7 +90,7 @@ export const uiSlice = createSlice({
// Tools
addTool: (state, action: PayloadAction<Tool>) => {
state.toolSettings[action.payload.function.name] =
action.payload.toolPolicy ?? "allowedWithPermission";
action.payload.toolPolicy ?? DEFAULT_TOOL_SETTING;
},
setToolPolicy: (
state,