mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-05-05 23:42:03 +00:00
Revert "Ignore workspace settings for untrusted folders" (#6672)
This commit is contained in:
parent
fd64d89da0
commit
52e340a11b
16 changed files with 122 additions and 386 deletions
|
|
@ -278,7 +278,6 @@ describe('App UI', () => {
|
|||
user?: Partial<Settings>;
|
||||
workspace?: Partial<Settings>;
|
||||
} = {},
|
||||
isTrusted = true,
|
||||
): LoadedSettings => {
|
||||
const systemSettingsFile: SettingsFile = {
|
||||
path: '/system/settings.json',
|
||||
|
|
@ -297,7 +296,6 @@ describe('App UI', () => {
|
|||
userSettingsFile,
|
||||
workspaceSettingsFile,
|
||||
[],
|
||||
isTrusted,
|
||||
);
|
||||
};
|
||||
|
||||
|
|
@ -379,9 +377,9 @@ describe('App UI', () => {
|
|||
const { unmount } = renderWithProviders(
|
||||
<App
|
||||
config={mockConfig as unknown as ServerConfig}
|
||||
settings={mockSettings}
|
||||
version={mockVersion}
|
||||
/>,
|
||||
mockSettings,
|
||||
);
|
||||
currentUnmount = unmount;
|
||||
|
||||
|
|
@ -405,9 +403,9 @@ describe('App UI', () => {
|
|||
const { lastFrame, unmount } = renderWithProviders(
|
||||
<App
|
||||
config={mockConfig as unknown as ServerConfig}
|
||||
settings={mockSettings}
|
||||
version={mockVersion}
|
||||
/>,
|
||||
mockSettings,
|
||||
);
|
||||
currentUnmount = unmount;
|
||||
|
||||
|
|
@ -435,9 +433,9 @@ describe('App UI', () => {
|
|||
const { lastFrame, unmount } = renderWithProviders(
|
||||
<App
|
||||
config={mockConfig as unknown as ServerConfig}
|
||||
settings={mockSettings}
|
||||
version={mockVersion}
|
||||
/>,
|
||||
mockSettings,
|
||||
);
|
||||
currentUnmount = unmount;
|
||||
|
||||
|
|
@ -465,9 +463,9 @@ describe('App UI', () => {
|
|||
const { lastFrame, unmount } = renderWithProviders(
|
||||
<App
|
||||
config={mockConfig as unknown as ServerConfig}
|
||||
settings={mockSettings}
|
||||
version={mockVersion}
|
||||
/>,
|
||||
mockSettings,
|
||||
);
|
||||
currentUnmount = unmount;
|
||||
|
||||
|
|
@ -499,9 +497,9 @@ describe('App UI', () => {
|
|||
const { unmount } = renderWithProviders(
|
||||
<App
|
||||
config={mockConfig as unknown as ServerConfig}
|
||||
settings={mockSettings}
|
||||
version={mockVersion}
|
||||
/>,
|
||||
mockSettings,
|
||||
);
|
||||
currentUnmount = unmount;
|
||||
|
||||
|
|
@ -528,9 +526,9 @@ describe('App UI', () => {
|
|||
const { lastFrame, unmount } = renderWithProviders(
|
||||
<App
|
||||
config={mockConfig as unknown as ServerConfig}
|
||||
settings={mockSettings}
|
||||
version={mockVersion}
|
||||
/>,
|
||||
mockSettings,
|
||||
);
|
||||
currentUnmount = unmount;
|
||||
await Promise.resolve();
|
||||
|
|
@ -547,9 +545,9 @@ describe('App UI', () => {
|
|||
const { lastFrame, unmount } = renderWithProviders(
|
||||
<App
|
||||
config={mockConfig as unknown as ServerConfig}
|
||||
settings={mockSettings}
|
||||
version={mockVersion}
|
||||
/>,
|
||||
mockSettings,
|
||||
);
|
||||
currentUnmount = unmount;
|
||||
await Promise.resolve();
|
||||
|
|
@ -583,9 +581,9 @@ describe('App UI', () => {
|
|||
const { lastFrame, unmount } = renderWithProviders(
|
||||
<App
|
||||
config={mockConfig as unknown as ServerConfig}
|
||||
settings={mockSettings}
|
||||
version={mockVersion}
|
||||
/>,
|
||||
mockSettings,
|
||||
);
|
||||
currentUnmount = unmount;
|
||||
await Promise.resolve();
|
||||
|
|
@ -611,9 +609,9 @@ describe('App UI', () => {
|
|||
const { lastFrame, unmount } = renderWithProviders(
|
||||
<App
|
||||
config={mockConfig as unknown as ServerConfig}
|
||||
settings={mockSettings}
|
||||
version={mockVersion}
|
||||
/>,
|
||||
mockSettings,
|
||||
);
|
||||
currentUnmount = unmount;
|
||||
await Promise.resolve();
|
||||
|
|
@ -632,9 +630,9 @@ describe('App UI', () => {
|
|||
const { lastFrame, unmount } = renderWithProviders(
|
||||
<App
|
||||
config={mockConfig as unknown as ServerConfig}
|
||||
settings={mockSettings}
|
||||
version={mockVersion}
|
||||
/>,
|
||||
mockSettings,
|
||||
);
|
||||
currentUnmount = unmount;
|
||||
await Promise.resolve(); // Wait for any async updates
|
||||
|
|
@ -653,9 +651,9 @@ describe('App UI', () => {
|
|||
const { lastFrame, unmount } = renderWithProviders(
|
||||
<App
|
||||
config={mockConfig as unknown as ServerConfig}
|
||||
settings={mockSettings}
|
||||
version={mockVersion}
|
||||
/>,
|
||||
mockSettings,
|
||||
);
|
||||
currentUnmount = unmount;
|
||||
await Promise.resolve();
|
||||
|
|
@ -674,9 +672,9 @@ describe('App UI', () => {
|
|||
const { lastFrame, unmount } = renderWithProviders(
|
||||
<App
|
||||
config={mockConfig as unknown as ServerConfig}
|
||||
settings={mockSettings}
|
||||
version={mockVersion}
|
||||
/>,
|
||||
mockSettings,
|
||||
);
|
||||
currentUnmount = unmount;
|
||||
await Promise.resolve();
|
||||
|
|
@ -701,9 +699,9 @@ describe('App UI', () => {
|
|||
const { lastFrame, unmount } = renderWithProviders(
|
||||
<App
|
||||
config={mockConfig as unknown as ServerConfig}
|
||||
settings={mockSettings}
|
||||
version={mockVersion}
|
||||
/>,
|
||||
mockSettings,
|
||||
);
|
||||
currentUnmount = unmount;
|
||||
await Promise.resolve();
|
||||
|
|
@ -726,9 +724,9 @@ describe('App UI', () => {
|
|||
const { lastFrame, unmount } = renderWithProviders(
|
||||
<App
|
||||
config={mockConfig as unknown as ServerConfig}
|
||||
settings={mockSettings}
|
||||
version={mockVersion}
|
||||
/>,
|
||||
mockSettings,
|
||||
);
|
||||
currentUnmount = unmount;
|
||||
await Promise.resolve();
|
||||
|
|
@ -747,9 +745,9 @@ describe('App UI', () => {
|
|||
const { lastFrame, unmount } = renderWithProviders(
|
||||
<App
|
||||
config={mockConfig as unknown as ServerConfig}
|
||||
settings={mockSettings}
|
||||
version={mockVersion}
|
||||
/>,
|
||||
mockSettings,
|
||||
);
|
||||
currentUnmount = unmount;
|
||||
await Promise.resolve();
|
||||
|
|
@ -771,9 +769,9 @@ describe('App UI', () => {
|
|||
const { lastFrame, unmount } = renderWithProviders(
|
||||
<App
|
||||
config={mockConfig as unknown as ServerConfig}
|
||||
settings={mockSettings}
|
||||
version={mockVersion}
|
||||
/>,
|
||||
mockSettings,
|
||||
);
|
||||
currentUnmount = unmount;
|
||||
await Promise.resolve();
|
||||
|
|
@ -793,9 +791,9 @@ describe('App UI', () => {
|
|||
const { lastFrame, unmount } = renderWithProviders(
|
||||
<App
|
||||
config={mockConfig as unknown as ServerConfig}
|
||||
settings={mockSettings}
|
||||
version={mockVersion}
|
||||
/>,
|
||||
mockSettings,
|
||||
);
|
||||
currentUnmount = unmount;
|
||||
await Promise.resolve();
|
||||
|
|
@ -806,9 +804,9 @@ describe('App UI', () => {
|
|||
const { unmount } = renderWithProviders(
|
||||
<App
|
||||
config={mockConfig as unknown as ServerConfig}
|
||||
settings={mockSettings}
|
||||
version={mockVersion}
|
||||
/>,
|
||||
mockSettings,
|
||||
);
|
||||
currentUnmount = unmount;
|
||||
await Promise.resolve();
|
||||
|
|
@ -816,21 +814,18 @@ describe('App UI', () => {
|
|||
});
|
||||
|
||||
it('should not display Tips component when hideTips is true', async () => {
|
||||
mockSettings = createMockSettings(
|
||||
{
|
||||
workspace: {
|
||||
hideTips: true,
|
||||
},
|
||||
mockSettings = createMockSettings({
|
||||
workspace: {
|
||||
hideTips: true,
|
||||
},
|
||||
true,
|
||||
);
|
||||
});
|
||||
|
||||
const { unmount } = renderWithProviders(
|
||||
<App
|
||||
config={mockConfig as unknown as ServerConfig}
|
||||
settings={mockSettings}
|
||||
version={mockVersion}
|
||||
/>,
|
||||
mockSettings,
|
||||
);
|
||||
currentUnmount = unmount;
|
||||
await Promise.resolve();
|
||||
|
|
@ -842,9 +837,9 @@ describe('App UI', () => {
|
|||
const { unmount } = renderWithProviders(
|
||||
<App
|
||||
config={mockConfig as unknown as ServerConfig}
|
||||
settings={mockSettings}
|
||||
version={mockVersion}
|
||||
/>,
|
||||
mockSettings,
|
||||
);
|
||||
currentUnmount = unmount;
|
||||
await Promise.resolve();
|
||||
|
|
@ -860,9 +855,9 @@ describe('App UI', () => {
|
|||
const { unmount } = renderWithProviders(
|
||||
<App
|
||||
config={mockConfig as unknown as ServerConfig}
|
||||
settings={mockSettings}
|
||||
version={mockVersion}
|
||||
/>,
|
||||
mockSettings,
|
||||
);
|
||||
currentUnmount = unmount;
|
||||
await Promise.resolve();
|
||||
|
|
@ -873,9 +868,9 @@ describe('App UI', () => {
|
|||
const { lastFrame, unmount } = renderWithProviders(
|
||||
<App
|
||||
config={mockConfig as unknown as ServerConfig}
|
||||
settings={mockSettings}
|
||||
version={mockVersion}
|
||||
/>,
|
||||
mockSettings,
|
||||
);
|
||||
currentUnmount = unmount;
|
||||
await Promise.resolve();
|
||||
|
|
@ -911,9 +906,9 @@ describe('App UI', () => {
|
|||
const { lastFrame, unmount } = renderWithProviders(
|
||||
<App
|
||||
config={mockConfig as unknown as ServerConfig}
|
||||
settings={mockSettings}
|
||||
version={mockVersion}
|
||||
/>,
|
||||
mockSettings,
|
||||
);
|
||||
currentUnmount = unmount;
|
||||
await Promise.resolve();
|
||||
|
|
@ -931,9 +926,9 @@ describe('App UI', () => {
|
|||
const { unmount } = renderWithProviders(
|
||||
<App
|
||||
config={mockConfig as unknown as ServerConfig}
|
||||
settings={mockSettings}
|
||||
version={mockVersion}
|
||||
/>,
|
||||
mockSettings,
|
||||
);
|
||||
currentUnmount = unmount;
|
||||
await Promise.resolve();
|
||||
|
|
@ -961,9 +956,9 @@ describe('App UI', () => {
|
|||
const { lastFrame, unmount } = renderWithProviders(
|
||||
<App
|
||||
config={mockConfig as unknown as ServerConfig}
|
||||
settings={mockSettings}
|
||||
version={mockVersion}
|
||||
/>,
|
||||
mockSettings,
|
||||
);
|
||||
currentUnmount = unmount;
|
||||
|
||||
|
|
@ -976,9 +971,9 @@ describe('App UI', () => {
|
|||
const { lastFrame, unmount } = renderWithProviders(
|
||||
<App
|
||||
config={mockConfig as unknown as ServerConfig}
|
||||
settings={mockSettings}
|
||||
version={mockVersion}
|
||||
/>,
|
||||
mockSettings,
|
||||
);
|
||||
currentUnmount = unmount;
|
||||
|
||||
|
|
@ -991,9 +986,9 @@ describe('App UI', () => {
|
|||
const { lastFrame, unmount } = renderWithProviders(
|
||||
<App
|
||||
config={mockConfig as unknown as ServerConfig}
|
||||
settings={mockSettings}
|
||||
version={mockVersion}
|
||||
/>,
|
||||
mockSettings,
|
||||
);
|
||||
currentUnmount = unmount;
|
||||
expect(lastFrame()).toMatchSnapshot();
|
||||
|
|
@ -1011,9 +1006,9 @@ describe('App UI', () => {
|
|||
const { lastFrame, unmount } = renderWithProviders(
|
||||
<App
|
||||
config={mockConfig as unknown as ServerConfig}
|
||||
settings={mockSettings}
|
||||
version={mockVersion}
|
||||
/>,
|
||||
mockSettings,
|
||||
);
|
||||
currentUnmount = unmount;
|
||||
expect(lastFrame()).toMatchSnapshot();
|
||||
|
|
@ -1041,9 +1036,9 @@ describe('App UI', () => {
|
|||
const { unmount, rerender } = renderWithProviders(
|
||||
<App
|
||||
config={mockConfig as unknown as ServerConfig}
|
||||
settings={mockSettings}
|
||||
version={mockVersion}
|
||||
/>,
|
||||
mockSettings,
|
||||
);
|
||||
currentUnmount = unmount;
|
||||
|
||||
|
|
@ -1051,6 +1046,7 @@ describe('App UI', () => {
|
|||
rerender(
|
||||
<App
|
||||
config={mockConfig as unknown as ServerConfig}
|
||||
settings={mockSettings}
|
||||
version={mockVersion}
|
||||
/>,
|
||||
);
|
||||
|
|
@ -1082,9 +1078,9 @@ describe('App UI', () => {
|
|||
const { lastFrame, unmount } = renderWithProviders(
|
||||
<App
|
||||
config={mockConfig as unknown as ServerConfig}
|
||||
settings={mockSettings}
|
||||
version={mockVersion}
|
||||
/>,
|
||||
mockSettings,
|
||||
);
|
||||
currentUnmount = unmount;
|
||||
await Promise.resolve();
|
||||
|
|
@ -1108,9 +1104,9 @@ describe('App UI', () => {
|
|||
const { unmount } = renderWithProviders(
|
||||
<App
|
||||
config={mockConfig as unknown as ServerConfig}
|
||||
settings={mockSettings}
|
||||
version={mockVersion}
|
||||
/>,
|
||||
mockSettings,
|
||||
);
|
||||
currentUnmount = unmount;
|
||||
|
||||
|
|
@ -1130,9 +1126,9 @@ describe('App UI', () => {
|
|||
const { unmount } = renderWithProviders(
|
||||
<App
|
||||
config={mockConfig as unknown as ServerConfig}
|
||||
settings={mockSettings}
|
||||
version={mockVersion}
|
||||
/>,
|
||||
mockSettings,
|
||||
);
|
||||
currentUnmount = unmount;
|
||||
|
||||
|
|
@ -1150,9 +1146,9 @@ describe('App UI', () => {
|
|||
const { lastFrame, unmount } = renderWithProviders(
|
||||
<App
|
||||
config={mockConfig as unknown as ServerConfig}
|
||||
settings={mockSettings}
|
||||
version={mockVersion}
|
||||
/>,
|
||||
mockSettings,
|
||||
);
|
||||
currentUnmount = unmount;
|
||||
expect(lastFrame()).toMatchSnapshot();
|
||||
|
|
@ -1176,9 +1172,9 @@ describe('App UI', () => {
|
|||
const { lastFrame, unmount } = renderWithProviders(
|
||||
<App
|
||||
config={mockConfig as unknown as ServerConfig}
|
||||
settings={mockSettings}
|
||||
version={mockVersion}
|
||||
/>,
|
||||
mockSettings,
|
||||
);
|
||||
currentUnmount = unmount;
|
||||
|
||||
|
|
@ -1198,9 +1194,9 @@ describe('App UI', () => {
|
|||
const { lastFrame, unmount } = renderWithProviders(
|
||||
<App
|
||||
config={mockConfig as unknown as ServerConfig}
|
||||
settings={mockSettings}
|
||||
version={mockVersion}
|
||||
/>,
|
||||
mockSettings,
|
||||
);
|
||||
currentUnmount = unmount;
|
||||
await Promise.resolve();
|
||||
|
|
@ -1218,9 +1214,9 @@ describe('App UI', () => {
|
|||
const { lastFrame, unmount } = renderWithProviders(
|
||||
<App
|
||||
config={mockConfig as unknown as ServerConfig}
|
||||
settings={mockSettings}
|
||||
version={mockVersion}
|
||||
/>,
|
||||
mockSettings,
|
||||
);
|
||||
currentUnmount = unmount;
|
||||
await Promise.resolve();
|
||||
|
|
@ -1238,9 +1234,9 @@ describe('App UI', () => {
|
|||
const { lastFrame, unmount } = renderWithProviders(
|
||||
<App
|
||||
config={mockConfig as unknown as ServerConfig}
|
||||
settings={mockSettings}
|
||||
version={mockVersion}
|
||||
/>,
|
||||
mockSettings,
|
||||
);
|
||||
currentUnmount = unmount;
|
||||
await Promise.resolve();
|
||||
|
|
@ -1487,9 +1483,9 @@ describe('App UI', () => {
|
|||
const { lastFrame, unmount } = renderWithProviders(
|
||||
<App
|
||||
config={mockConfig as unknown as ServerConfig}
|
||||
settings={mockSettings}
|
||||
version={mockVersion}
|
||||
/>,
|
||||
mockSettings,
|
||||
);
|
||||
currentUnmount = unmount;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue